-
how to get unmatched records from database tables ?
Hi
The below query returns the matched records for left table (Sheet1 ):
"SELECT [Sheet1$A1:A24].ColA FROM [Sheet1$A1:A24] where [Sheet1$A1:A24].ColA in (SELECT Distinct([Sheet1$A1:A24].ColA) FROM [Sheet1$A1:A24],[Sheet2$A1:A23] where [Sheet1$A1:A24].ColA = [Sheet2$A1:A23].ColB)"
But the above query when used with not in never returns me the unmatched records from left table (Sheet1)
"SELECT [Sheet1$A1:A24].ColA FROM [Sheet1$A1:A24] where [Sheet1$A1:A24].ColA not in (SELECT Distinct([Sheet1$A1:A24].ColA) FROM [Sheet1$A1:A24],[Sheet2$A1:A23] where [Sheet1$A1:A24].ColA = [Sheet2$A1:A23].ColB)"
when i ran the similar query in the Query editor of SQL it retuns me the unmatched records from the left table.
Any suggestions ?
My main intention is to get the unmatched records for first table as well as second table separately.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules