Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 27, 2012 11:13 AM by dhol.gaurav
Member
7 Points
74 Posts
Dec 27, 2012 11:08 AM|LINK
how to get the values from table A when it does not exists in table B and when Values exists in Table B it should not return, by having some matching fields in both tables.
All-Star
34177 Points
5490 Posts
Dec 27, 2012 11:12 AM|LINK
like this?
select * from TableA where columnX_TableA not in (select columnX_TableB from TableB)
hope this helps...
Participant
1459 Points
643 Posts
Review this short article http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html
Contributor
3998 Points
725 Posts
Dec 27, 2012 11:13 AM|LINK
Hi,
You can do using joins example given as below
Select A.* From TableA A Inner Join TableB B Where A.ID != B.ID
OR
Select A.* From TableA A Left outer Join TableB B Where A.ID != B.ID
let me know if any query
imranbasha
Member
7 Points
74 Posts
Problem with getting values from one table when it not exists in other table in SQL SERVER 2008
Dec 27, 2012 11:08 AM|LINK
how to get the values from table A when it does not exists in table B and when Values exists in Table B it should not return, by having some matching fields in both tables.
kedarrkulkar...
All-Star
34177 Points
5490 Posts
Re: Problem with getting values from one table when it not exists in other table in SQL SERVER 20...
Dec 27, 2012 11:12 AM|LINK
like this?
select * from TableA where columnX_TableA not in (select columnX_TableB from TableB)
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
Nick Asiimwe
Participant
1459 Points
643 Posts
Re: Problem with getting values from one table when it not exists in other table in SQL SERVER 20...
Dec 27, 2012 11:12 AM|LINK
Review this short article http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html
Sincerely,
Nick
ASP.NET, SQL Server [Database Engine, SSIS & SSRS],Entity Framework, C# and VB.NET
dhol.gaurav
Contributor
3998 Points
725 Posts
Re: Problem with getting values from one table when it not exists in other table in SQL SERVER 20...
Dec 27, 2012 11:13 AM|LINK
Hi,
You can do using joins example given as below
Select A.* From TableA A Inner Join TableB B Where A.ID != B.ID
OR
Select A.* From TableA A Left outer Join TableB B Where A.ID != B.ID
let me know if any query
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer