|
atomic-value RelOp ANY ( set of values ) |
Meaning of the any-expression:
|
SELECT fname, lname FROM employee WHERE salary >= ANY ( 30000, 50000 ) |
Result of this query:
|
SELECT fname, lname FROM employee WHERE salary >= ANY ( 30000, 50000 ) ^^^^^^^^^^^^^^ Explicit set of values |
Reason:
|
atomic-value RelationalOperator ALL ( set of values ) |
Meaning of the all-condition:
|
SELECT fname, lname FROM employee WHERE salary >= ALL ( 30000, 50000 ) |
Result of this query:
|
|
|
The reasons are explained next....
SELECT fname, lname FROM employee WHERE ssn = ANY ('111-11-1111', '222-22-2222') |
meaning:
|
The condition is equivalent to:
SELECT fname, lname FROM employee WHERE ssn IN ('111-11-1111', '222-22-2222') |
SELECT fname, lname FROM employee WHERE ssn != ALL ('111-11-1111', '222-22-2222') |
meaning:
|
The condition is equivalent to:
SELECT fname, lname FROM employee WHERE ssn NOT IN ('111-11-1111', '222-22-2222') |
|
x = ALL ( 1, 2 ) is always FALSE !!! // Try: x = 0 --> 0 != 1, so false // Try: x = 1 --> 1 != 2, so false // Try: x = 2 --> 2 != 1, so false // Try: x = 3 --> 3 != 1, so false // And so on... |
|
EXISTS ( set of values ) |
Meaning of the
EXISTS-condition:
(I.e.: a value
exists
in the set)
(I.e.: the (set of values)
is the empty set)