Reputation: 51
select ID,MRN,FileName from Upload$ t1
EXCEPT
Select MRN,FileName from Sheet1$
Here i would like to compare MRN and FileName from both table
Upvotes: 1
Views: 544
Reputation: 50163
Your current EXCEPT
statement is correct as you need to check records which are not exists in second table from first table.
select t1.* from Upload$ t1
LEFT OUTER JOIN Sheet1$ S
ON S.MRN = t1.MRN AND t1.FileName = S.FileName
WHERE S.MRN IS NULL AND S.FileName IS NULL
So, here is alternative approach via JOIN
s (i.e. LEFT OUTER JOIN
) to check record which are not exists in second table from first table and return not exists records from first table
Upvotes: 1