CoderZone.org

Category: >> mySQL >> A minus B query Bookmark and Share

<< lastnext >>

Snippet Name: A minus B query

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

Comment: (none)

Author: CoderZone
Language: MYSQL
Highlight Mode: MYSQL
Last Modified: March 01st, 2009

SELECT DISTINCT a.member_id, a.name
FROM a LEFT JOIN b USING (member_id, name)
WHERE b.member_id IS NULL
 
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 9