A minus B query

Submitted by:Pitter Alderson

Date added:23 March, 2016

Category:MySQL

Get contents of table where the item does NOT exist in another table.

Tags: distinct , mysql query

Code Snippet:

SELECT DISTINCT a.member_id, a.name
FROM a LEFT JOIN b USING (member_id, name)
WHERE b.member_id IS NULL
 
 

Comments