Deviprasad Das
Deviprasad Das

Reputation: 4373

How to get unmatched records using SQL query?

Actually if i am doing INNER JOIN of two tables then i will 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?

Upvotes: 2

Views: 3720

Answers (1)

Oded
Oded

Reputation: 499352

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.

Upvotes: 3

Related Questions