Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqltrouble
Starting Member
2 Posts |
Posted - 2006-10-12 : 17:57:39
|
How do I find records in table A that are not in table B?Select ID from tableA where tableA.ID NOT IN (Select ID from tableB) is not working. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-10-12 : 19:43:31
|
Use NOT EXISTS.Tara Kizer |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-12 : 21:14:54
|
>>Select ID from tableA where tableA.ID NOT IN (Select ID from tableB) is not working.Why?Did you get wrong results?Did you get error?MadhivananFailing to plan is Planning to fail |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-10-12 : 22:42:15
|
Try this:select IDfrom tableAwhere tableA.ID NOT IN ( Select ID from tableB where ID is not null ) CODO ERGO SUM |
 |
|
sqltrouble
Starting Member
2 Posts |
Posted - 2006-10-13 : 12:34:47
|
Thank you Michael. That did it! |
 |
|
|
|
|