How to get unmatched records using SQL query?
Actually if i am doing INNER JOIN of two tables then i will开发者_Python百科 get all matched records from the two tables. But i want to get all the unmatched rows only.
Is there any way to do that? Or Any JOIN available for that?
There is join you can use. You need an OUTER JOIN
, and only select rows with a NULL
on the join condition.
Another option is to use a sub query with a NOT EXISTS
or NOT IN
as part of your main WHERE
clause.
精彩评论