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


         )


No comments:

Post a Comment