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 2005 Forums
 Transact-SQL (2005)
 find record not in 2nd table as compare 1st table

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2011-08-12 : 00:56:06
Dear member

How to find the record in second table which is not in first table as compare two column in both table


thanks in advance

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-12 : 01:53:26
select *
from t2
where not exists (select * from t1 where t1.c1 = t2.c1 and t1.c2 = t2.c2)

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

Subscribe to my blog
Go to Top of Page

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2011-08-12 : 02:34:36
thank Tara Kizer
itis done
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-12 : 02:52:02
You're welcome, glad to help.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -