Skip to content
Advertisement

SQL to get all combination with intersection of events

I have a table(transaction) with consumer_id and item_id. I want to output all combinations of items and number of customers purchased both the item. How can this be done in SQL.

Advertisement

Answer

I think you want a self-join:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement