SQL Server Admin
T-SQL Articles

February 24, 2009

Retrieve Records in Table A not present in Table B using SQL Server




Here's a query to retrieve records in Table A that are not present in Table B using SQL Server



SELECT tbla.ColumnA, tbla.ColumnB, tbla.ColumnC


FROM   TableA tbla


WHERE


  Not Exists(


        SELECT 1 FROM TableB tblb


        WHERE


          tbla.ColumnA = tblb.ColumnA 


          and tbla.ColumnB = tblb.ColumnB


          and tbla.ColumnC = tblb.ColumnC


         )



Did you like this post?
kick it on DotNetKicks.com
subscribe via rss subscribe via e-mail
print this post follow me on twitter



 
  Feedback:

comments

0 Responses to "Retrieve Records in Table A not present in Table B using SQL Server"
 

Copyright © 2009-2011 All Rights Reserved for SQLServerCurry.com by Suprotim Agarwal | Terms and Conditions