djp1988 Posted January 9, 2009 Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now