Hi when do you use ANY,SOME, ALL

  • From: "Juan Carlos Reyes Pacheco" <jreyes@xxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 25 Jun 2004 17:39:33 -0400

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);
 
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: