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 |
jonhath
Starting Member
13 Posts |
Posted - 2007-11-15 : 12:07:46
|
I'm trying to write a query that will return a person's information if their ID is -not- in a column in a different table.For example:IDCheck001003005 IDNumber FirstName LastName 001 Bob Jones002 Jill Smith003 Jon Doe004 Jeff Miller005 Harry Douglas The output I want would be:IDNumber FirstName LastName 002 Jill Smith004 Jeff Miller Because their IDs are not in the IDCheck table. The actual implementation is a lot more complex and the IDCheck table is dynamically generated. If someone could point me in the right direction I'd really appreaciate it. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-15 : 12:17:03
|
SELECT t1.*FROM Table1 t1LEFT OUTER JOIN Table2 t2ON t1.IDNumber = t2.IDCheckWHERE t2.IDCheck IS NULLTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|