exists

Thumbnail image for SQL to Find Master Records with Identical Detail Records

SQL to Find Master Records with Identical Detail Records

SQL to find those records in the master table that have identical detail records in a child table.

Read the Full Article →
Thumbnail image for DISTINCT and How NOT To Use It

DISTINCT and How NOT To Use It

Oracle keyword DISTINCT restricts the result to unique rows from a query, but DISTINCT is often used as a quick fix to bad queries. Some practices to avoid when using DISTINCT.

Read the Full Article →
Thumbnail image for IN = EXISTS, but beware: NOT IN is not the same as NOT EXISTS!

IN = EXISTS, but beware: NOT IN is not the same as NOT EXISTS!

In Oracle SQL queries, IN and EXISTS are interchangeable. Many of us assume therefore, that NOT IN and NOT EXISTS are also interchangeable. That’s not the case though.

Read the Full Article →
Thumbnail image for Which is faster – IN or EXISTS?

Which is faster – IN or EXISTS?

A question asked multiple times over on Oracle forums: Which is faster – IN or EXISTS? The short answer, post-Oracle 9i is: Both are pretty much the same!

Read the Full Article →