Query to find matching patterns in a table
Posted on 2009-12-18
I'm looking to construct a query that would pull matching groups of record from a table. Specifically, the table is a list of items ordered by customers in an e-commerce site. What I'm trying to find is all of the customers who ordered a specific group of products.
Here's a simplified version of my table structure:
Simply put, I want to pull a list of customers who ordered ProductID 31, Product ID 61 (twice) Product ID 59, Product ID 60, and Product ID 9999 all within the same order. It doesn't matter if they ordered items in addition to these.