Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Hi when do you use ANY,SOME, ALL
Hi List,
I don't understand when one must use ANY, SOME or ALL
I don't understand the use of the use of this optoins
I suppose they were added only to give more SQL ansi compatibility
SELECT USR_NOMSIS FROM UTL_USUARIO_SIS WHERE PER_CI = ALL (SELECT -2354 FROM
UTL_USUARIO_SIS WHERE 1=0)
ORDER BY 1
ANY
SOME
Compares a value to each value in
a list or returned by a query. Must
be preceded by =, !=, >, <, <=, >=.
Evaluates to FALSE if the query
returns no rows.
SELECT * FROM employees
WHERE salary = ANY
(SELECT salary
FROM employees
WHERE department_id = 30);
ALL Compares a value to every value
in a list or returned by a query.
Must be preceded by =, !=, >, <,
<=, >=.
Evaluates to TRUE if the query
returns no rows.
SELECT * FROM employees
WHERE salary >=
ALL ( 1400, 3000);
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Fri Jun 25 2004 - 16:40:51 CDT
![]() |
![]() |