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

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Usage » Querying and Modifying Data » Using subqueries

 

Testing subqueries

The chapter Querying data describes simple search conditions you can use in the HAVING clause. Since a subquery is just an expression that appears in the WHERE or HAVING clauses, the search conditions on subqueries may look familiar.

They include:

  • Subquery comparison test   Compares the value of an expression to a single value produced by the subquery for each record in the table(s) in the main query. Comparison tests use the operators (=, <>, <. <=, >, >=) provided with the subquery.

  • Quantified comparison test   Compares the value of an expression to each of the set of values produced by a subquery.

  • Subquery set membership test   Checks if the value of an expression matches one of the set of values produced by a subquery.

  • Existence test   Checks if the subquery produces any rows.


Subquery comparison test
Subqueries and the IN test
Subqueries and the ANY test
Subqueries and the ALL test
Subqueries and the EXISTS test