Forum Moderators: open
Basically, I have two tables that look like this:
table1
userid
1
2
3
4
5
6
7
table2
myid . . .addedid
2 . . . . 4
2 . . . . 5
What i need to do is find a way to list the users in table1 that are NOT listed in 'addedid' in table two.
This is the basic select statement that I'm using:
SELECT table1. * , table2. * FROM table1 LEFT JOIN table2 ON table1.userid = table2.addedid
Which lists the results like this:
userid . . myid . . addedid
1 . . . . .null . . null
2 . . . . .null . . null
3 . . . . .null . . null
4 . . . . .2 . . . .4
5 . . . . .2 . . . .5
6 . . . . .null . . null
7 . . . . .null . . null
What I want to do is display only the results that have "myid" and "addedid" as null. I tried adding "WHERE users.userid!=adds.addedid" to the original SELECT statement's ending, but it doesn't work. I also tried adding "WHERE "myid=null", but that doesn't work either. How can I achieve the result that I want?
[edited by: JMusic at 5:59 am (utc) on Dec. 11, 2006]