-
John,
For 1 and 2:
select customerID from purchases t1 where
itemID = 1 and exists (select customerID from purchases t2
where t2.itemID = 2 and t1.customerID = t2.customerID)
For 1, 2, and 3:
select customerID from purchases t1 where
itemID = 1 and exists (select customerID from purchases t2
where t2.itemID = 2 and t1.customerID = t2.customerID)
and exists (select customerID from purchases t3
where t3.itemID = 3 and t1.customerID = t3.customerID)
Jeff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|