Progress
SQL-92
Guide and Reference


Quantified Predicate

The quantified predicate compares a value with a collection of values using a relational operator (see the "Relational Operators" section). A quantified predicate has the same form as a basic predicate with the query_expression being preceded by the ALL, ANY, or SOME keyword. The result table returned by query_expression can contain only a single column.

When you specify ALL, the predicate evaluates to true if the query_expression returns no values or the specified relationship is true for all the values returned.

When you specify SOME or ANY, the predicate evaluates to true if the specified relationship is true for at least one value returned by the query_expression. There is no difference between the SOME and ANY keywords. The predicate evaluates to false if the query_expression returns no values or if the specified relationship is false for all the values returned.

This is the syntax for a quantified_predicate:

SYNTAX
expression relop { ALL | ANY | SOME } ( query_expression ) 

EXAMPLE

10 < ANY ( SELECT COUNT(*) 
         FROM order_tbl
         GROUP BY custid ;
          ) 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095