>select cust_id from customer where cust_id in > (select cust_id from purchased > where item_id = soap and cust_id in > (select cust_id from purchased > where item_id = towels and cust_id in > (select cust_id from purchased where item_id = toothbrush) > ) > ) I'd take a radically different approach: build a cursor with the items that must be on the order to qualify, and call that MustHave. Now try: nNumItems = RECCOUNT('MustHave') SELECT cust_id, item_id FROM Purchased ; INTO CURSOR CandCusts ; WHERE item_id IN (SELECT item_id from MustHave) ; GROUP BY cust_id, Item_Id ; ORDER BY cust_id, Item_id SELECT Cust_ID, COUNT(*) AS NumMatches FROM CandCusts ; INTO CURSOR TheseCustsBoughtEverything ; GROUP BY Cust_ID ; HAVING NumMatches = nNumItemsThe first SELECT pulls order items that are on our list of MustHave items; we want only one record per cust_id, item_id pair, so I've cheated and used a GROUP BY rather than a DISTINCT clause to cull duplicates. We now have a table of all cust_ids that matched some item_id we were looking for.