djp1988 Posted January 9, 2009 Share Posted January 9, 2009 I have 2 tables, like so:id | name1 | daniel2 | mike3 | danand another:id_2 | ref1 | 12 | 1 3 | 3 4 | 1I wish to do an SQL to show what lines of the first table are not referenced in the second table, so this result should show:'mike' Link to comment Share on other sites More sharing options...
pulpfiction Posted January 9, 2009 Share Posted January 9, 2009 Try this SELECT NAME FROM TABLE1 WHERE ID NOT IN (SELECT REF FROM TABLE2) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.