Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » SQL Anywhere Server - SQL Usage » Query and modify data » Use of subqueries » Optimizer automatic conversion of subqueries to joins


Subquery that follows EXISTS

The optimizer converts a subquery that follows the EXISTS keyword only if:

  • The main query does not contain a GROUP BY clause, and is not an aggregate query, or the subquery returns exactly one value.

  • The conjunct 'EXISTS (subquery)' is not negated.

  • The subquery is correlated; that is, it contains an outer reference.