SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 select data from table B
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shanmugaraj
Posting Yak Master

214 Posts

Posted - 01/22/2013 :  01:28:11  Show Profile  Send shanmugaraj a Yahoo! Message  Reply with Quote
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 - 01/22/2013 :  02:39:55  Show Profile  Reply with Quote
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

India
11 Posts

Posted - 01/22/2013 :  02:46:36  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000