4D v14

all_or_any_predicate

Home

 
4D v14
all_or_any_predicate

all_or_any_predicate  


 

 

Command all_or_any_predicatarithmetic_expression {< | <= | = | >= | > | <>} {ANY | ALL | SOME} (subquery)

An all_or_any_predicate is used to compare an arithmetic_expression with a subquery. You can pass comparison operators like <, <=, =, >=, > or <> as well as the ANY, ALL and SOME keywords along with the subquery to be used for comparison.

Example  

This example carries out a subquery which selects the best software sales. The main query selects records from the SALES and CUSTOMERS tables where the Total_value column is greater than the records selected by the subquery:

SELECT Total_value, CUSTOMERS.Customer
FROM SALES, CUSTOMERS
WHERE SALES.Customer_ID = CUSTOMERS.Customer_ID
AND Total_value > ALL   (SELECT MAX (Total_value)
FROM SALES
WHERE Product_type = 'Software');

 
PROPERTIES 

Product: 4D
Theme: Syntax rules

 
SEE ALSO 

arithmetic_expression
predicate
subquery

 
ARTICLE USAGE

4D SQL Reference ( 4D v11 SQL Release 4 )
4D SQL Reference ( 4D v14)
4D SQL Reference ( 4D v12.1)
4D SQL Reference ( 4D v13.4)
4D SQL Reference ( 4D v14 R2)
4D SQL Reference ( 4D v14 R3)
4D SQL Reference ( 4D v14 R4)