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
 General SQL Server Forums
 New to SQL Server Programming
 join query

Author  Topic 

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-05-17 : 06:22:51
i hav 2 tables which contain a common field called ID.
Table A Table B
ID ID
a a
b b
c
d

Now i want results from Table A in such way that ID's Which are in table B do not get selected in table A.
how do i use join query for this

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-05-17 : 06:25:58
Select * from TableA A where not exists(select * from TableB where Id=A.Id)

Also Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-05-17 : 06:46:27
thanx
Go to Top of Page
   

- Advertisement -