SELECT column FROM table1 WHERE column OPERATOR ANY (SELECT column FROM table2);
<
, <=
, =
, >
, >=
, !=
SELECT * FROM teachers WHERE age = ANY (SELECT age FROM students);
students
table)age
in teachers
table with any age
in students
SELECT column FROM table1 WHERE column OPERATOR ALL (SELECT column FROM table2);
SELECT * FROM teachers WHERE age > ALL (SELECT age FROM students);
students
tableSELECT * FROM teachers WHERE age < ALL (SELECT age FROM students);