Recommended Free Tools
In SQL, the quantified predicate ALL makes a comparison true when its subquery returns no rows. For example, 10 > ALL (SELECT value FROM t) is true if that subquery is empty. This rule belongs to SQL’s ALL quantifier—not to comparison operators in every programming language.
What SQL ALL means
ALL combines a comparison operator with a subquery. The comparison must hold for every value the subquery returns. So 10 > ALL (SELECT value FROM t) asks whether 10 is greater than every returned value.
As an Amazon Associate I earn from qualifying purchases.
If the subquery returns no values, there is no value that violates the condition. In logic, a statement that applies to every member of an empty set is true: there is no counterexample. Firebird’s documentation on quantified predicates explicitly describes this empty-set behavior.
How ALL differs from ANY and SOME
ANY and SOME ask whether the comparison holds for at least one value returned by the subquery. With no values, there cannot be a matching value, so the result is false. The contrast is:
#1 Best Overall
| Predicate | Question | Result for an empty subquery |
|---|---|---|
ALL |
Does the comparison hold for every returned value? | True |
ANY or SOME |
Does the comparison hold for at least one returned value? | False |
For example, if the subquery is empty, 10 > ALL (SELECT value FROM t) is true, while 10 > ANY (SELECT value FROM t) is false. The SQL-99 reference on searching with subqueries describes the same distinction.
Why NULL makes a different case
An empty result and a non-empty result containing NULL are not equivalent. SQL comparisons involving NULL can evaluate to UNKNOWN, rather than true or false. Consequently, a comparison quantified over rows that include NULL may not produce the simple result you would get from ordinary non-NULL values. Firebird and the SQL-99 reference document this distinction; consult the documentation for your database when NULLs or dialect-specific behavior matter.
Why this is not a universal comparison-operator rule
The phrase “comparison operator” can mean different things across languages. SQL’s ALL is a quantifier used with an operator such as > or =; it is not itself an operator like >.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →PowerShell provides a useful contrast. Microsoft’s PowerShell 7.4 comparison-operator documentation says that a scalar on the left produces a Boolean, while a collection on the left produces the matching elements; if there are no matches, the result is an empty array. That is a different behavior from SQL’s quantified predicate.
C++ also uses the term “three-way comparison operator” for <=>, sometimes called the spaceship operator. It is a separate language feature, not SQL’s ALL predicate.
Check your database’s syntax
The empty-set rule explains the logic of SQL quantified comparisons, but accepted syntax and supported operators can vary by database. Firebird, for example, documents its own supported comparison operators and specifies that its quantifiers take a subselect. Check the reference for the database you use before adapting an example.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →




