CREATE TABLE t (cust_id, item); INSERT INTO t VALUES (1,'book'); INSERT INTO t VALUES (1,'shoe'); INSERT INTO t VALUES (2,'book'); INSERT INTO t VALUES (3,'shoe');
SELECT cust_id FROM t WHERE item='book' INTERSECT SELECT cust_id FROM t WHERE item='shoe';