Skip to main content
The EXISTS operator checks how many records are in the result of a subquery. If it is empty, then the operator returns 0. Otherwise, it returns 1. EXISTS can also be used in a WHERE clause.
References to main query tables and columns are not supported in a subquery.
Syntax
Example Query checking existence of values in a subquery:
Query
Response
Query with a subquery returning several rows:
Query
Response
Query with a subquery that returns an empty result:
Query
Response
Last modified on July 2, 2026