Database Reference
In-Depth Information
The ANY ( or SOME) operator and ALL operator both work nicely with nested
queries. The expression on the left is compared to any row or all rows from the sub-query
on the right. In using these operators, the following convention must be noted:
< ANY(…) means less than the maximum value
= ANY(…) is equivalent to IN (…)
> ANY(…) means greater than the minimum value
> ALL(…) means greater than the maximum value
< ALL(…) means less than the minimum value
Example 40: Referring to the Oracle employee-department database, produce a list
of employees who earn less than the maximum salary of a secretary:
Example 41: Referring to the Oracle employee-department database, produce a list
of employees who earn less than the minimum salary of a secretary:
Example 42: Referring to the Oracle employee-department database (described
in section 12.8.5), produce a list of employees who earn more than the average earning
for his/her department (show both the employee's salary and his/her department's
average salary):
 
Search WWH ::




Custom Search