Oracle SQL, A Beginner’s Tutorial, Second Edition by Djoni Darmawikarta

Oracle SQL, A Beginner’s Tutorial, Second Edition by Djoni Darmawikarta

Author:Djoni Darmawikarta [Darmawikarta, Djoni]
Language: eng
Format: azw3
Publisher: BrainySoftware
Published: 2016-01-12T16:00:00+00:00


The ALL and ANY Operators

In addition to IN and NOT IN, you can also use the ALL and ANY operators in a multiple-row subquery. With ALL or ANY you use a comparison operator. For instance, the query in Listing 6.4 uses the ALL operator to compare the price column with the subquery result.

Listing 6.4: Using ALL

SELECT * FROM product WHERE price >= ALL (SELECT MAX(price) FROM product p INNER JOIN c_order o ON o.p_code = o.p_code GROUP BY p.launch_dt ) ORDER BY p_code;

Run against the same product and order tables, the subquery in Listing 6.4 (printed in bold) returns these results:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.