Skip to content

Glossary: SQL Beyond the Basics

EXISTS

Also written: NOT EXISTS

A test that is true if a subquery returns at least one row; NOT EXISTS is true when it returns none. NOT EXISTS is a safe way to write an anti-join.

Where the book teaches it

Related terms

Anti-joinCorrelated subqueryNOT IN trap