July 2010
Intermediate to advanced
840 pages
16h 33m
English
THE EXISTS PREDICATE IS very natural. It is a test for a nonempty set. If there are any rows in its subquery, it is TRUE; otherwise, it is FALSE. This predicate does not give an UNKNOWN result. The syntax is:
<exists predicate> ::= EXISTS <table subquery>
It is worth mentioning that a <table subquery> is always inside parentheses to avoid problems in the grammar during parsing.
In SQL-89, the rules stated that the subquery had to have a SELECT clause with one column or a *. If the SELECT * option was used, the database engine would (in theory) pick one column and use it. This fiction was needed because SQL-89 defined subqueries as having only one column.
Some early SQL implementations would work better with EXISTS(SELECT ...
Read now
Unlock full access