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.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 select records from a table that isnt in other

Author  Topic 

shifis
Posting Yak Master

157 Posts

Posted - 2006-07-06 : 12:53:47
Hi, i got brain freeze and dont know how to solve my problem.

I got 2 tables with the same type of data, what i need is select the records that are in the first table but arent in the second.

Any idea will be helpful.

X002548
Not Just a Number

15586 Posts

Posted - 2006-07-06 : 13:02:07
SELECT * FROM table1 a WHERE NOT EXISTS (SELECT * FROM table2 b WHERE a.key = b.key)



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page
   

- Advertisement -