Back
Can anyone explain how to get unmatched records from two tables in SQL?
‘IN’ operator can be used to get the unmatched records from two tables in SQL and the following query is for that:
SELECT TableA.idFROM TableAWHERE TableA.id NOT IN ( SELECT TableB.id FROM TableB )
SELECT TableA.id
FROM TableA
WHERE TableA.id NOT IN (
SELECT TableB.id
FROM TableB
)
If you want to learn SQL from top experts, you can check out this SQL Training course by Intellipaat.
31k questions
32.8k answers
501 comments
693 users