SQL Check one list against Another
问题 I'd appreciate any pointers on how in SQL to check whether elements in one list also appear in another. List A = Live Customers in April List B = Live Customers in May How can I check which Customers in List A also appear in List B ? to identify those Customers which have been lost i.e. Customers in A but not in B. Thank you for your help. Gav 回答1: Different ways to pull the results SELECT customer FROM ListA a WHERE NOT EXISTS (SELECT 1 FROM ListB b WHERE a.customer=b.customer) OR SELECT a