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
 select data from table B

Author  Topic 

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2013-01-22 : 01:28:11
TABLE_A Table_B
1 Raj 1 Raj
2 Ravi 2 Ravi
3 Selvi 3 Selvi
4 Suguna
5 Devi

I want to select 4,5 records using join query

THANKS
SHANMUGARAJ
nshanmugaraj@gmail.com

karthik0805
Starting Member

14 Posts

Posted - 2013-01-22 : 02:39:55
Select A.* from TABLE_A A LEFT JOIN TABLE_B B ON A.ID=B.ID WHERE B.ID IS NULL
Go to Top of Page

shenulal
Starting Member

11 Posts

Posted - 2013-01-22 : 02:46:36
Do you want to use this for only this condition or more generally.
You can use the following i think;

SELECT Table_A.ID, Table_A.Name from Table_A LEFT OUTER JOIN
TABLE_B ON TABLE_A.ID=TABLE_B.ID WHERE
TABLE_B.ID IS NULL
Go to Top of Page
   

- Advertisement -