751 views
2 votes
2 votes

I was reading an article regarding the use of ALL, SOME, ANY operatorshttps://oracle-base.com/articles/misc/all-any-some-comparison-conditions-in-sql . In the ALL section, it was mentioned that "If a subquery returns zero rows, the condition evaluates to TRUE" . In the ANY section, however, it was mentioned that "If a subquery returns zero rows, the condition evaluates to FALSE." . Why are the results of the same subquery different for two operators ? It should evaluate to false for both the cases. What am I missing here ?

1 Answer

Best answer
6 votes
6 votes
ALL ( {} ) = TRUE

ANY ( {} ) = FALSE

This is just the semantic of ALL and ANY. ALL means the condition must be true for ALL tuples and hence this becomes trivially TRUE for {}. ANY means there must exist at least one tuple for which the condition is TRUE and hence this becomes trivially false for {}.

Related questions

0 votes
0 votes
0 answers
1
shikharV asked Jan 4, 2016
395 views
I couldn't understand its solution. Please explain
1 votes
1 votes
3 answers
2
sh!va asked Feb 8, 2017
1,224 views
Consider the following relation instance myTablenum1num2100100100NULLNULL100NULLNULL Query 1:SELECT *FROM myTableWHERE num1 != NULL;Query 2:SELECT *FROM myTableWHERE num1...
0 votes
0 votes
4 answers
3
ShiveshRoy asked Apr 1, 2016
2,169 views
What will COUNT(*) returns if all the collection has only null values???
0 votes
0 votes
2 answers
4
print asked Jan 21, 2022
502 views
Source Made Easy Test SeriresCan anyone please tell me the answer for this, with explaination. According to me it will give the customer who buy from atleast one store, b...