...

View Full Version : select rows where field not in table



bitbob
03-19-2007, 08:42 AM
I have three tables table1, table2 and a relation (* <-> *) btween the two - table3.
to select rows from table1 i have:


SELECT table1.* FROM table1, table3 WHERE table1.field1 = table3.tbl1field1 AND table3.table2ID = 5
// 5 is an example ID from table2


How do I negate the result? Getting all rows that don't have an entry in table3 for table2ID = 5?

SSJ
03-19-2007, 11:15 AM
really didn't get what you want to say?
Explain it more...

bitbob
03-19-2007, 12:26 PM
sorry... anyway I fixed it... I just had a black out there... what I looked for was WHERE x NOT IN (SELECT x FROM ....)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum