PL/SQL ANY

The PL/SQL ANY is used like comparison condition, must be preceded by =, !=, >, < , <=, >= and followed by a list or subquery.

ANY example

 
SELECT * FROM course WHERE price = ANY (10,20);

Output

COURSE_IDNAMEDESCRIPTIONDURATIONPRICE
1SQL 1SQL course for beginners1 week10
3HTML5Learn HTML 51 week10
5CSSLearn CSS2 week20

ANY example

 
SELECT s.student_id, s.first_name, s.last_name, s.city 
FROM students s 
WHERE s.student_id = ANY (SELECT o.student_id FROM orders o)
ORDER BY s.student_id;

Output

STUDENT_IDFIRST_NAMELAST_NAMECITY
4EmilyPETERSONPhoenix
5DavidDAWSONSeattle
6GabrielLEWISBoston
7NatalieMARTINBaltimore