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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Outer join i think

Author  Topic 

tpayne
Starting Member

18 Posts

Posted - 2009-04-06 : 16:45:20
I have two Tables A and B. They are related by a field called tsr. I want to get all the records in table a that do not exist in table b.

thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-04-06 : 16:52:03
You can use an OUTER JOIN, NOT EXISTS, or NOT IN.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-04-07 : 01:08:06
try this one too
select a.* from tablea a left join tableb b on b.tsr = a.tsr
where b.tsr is null
Go to Top of Page
   

- Advertisement -