fork download
  1. CREATE TABLE t (cust_id, item);
  2.  
  3. INSERT INTO t VALUES (1,'book');
  4. INSERT INTO t VALUES (1,'shoe');
  5. INSERT INTO t VALUES (2,'book');
  6. INSERT INTO t VALUES (3,'shoe');
Success #stdin #stdout 0s 3008KB
stdin
SELECT cust_id FROM t WHERE item='book'
INTERSECT 
SELECT cust_id FROM t WHERE item='shoe';
stdout
1