In SQL, all logical operators evaluate to TRUE, FALSE, and UNKNOWN ( Oracle docs ) as a result of MySQL UNKNOWN calls NULL ( MySQL Docs ).
According to oracle documentation:
"To check for zeros, use only the comparison conditions IS NULL and IS NOT ZERO. If you use any other condition with zeros and the result depends on null, then the result is UNKNOWN."
Thus, after evaluation only TRUE, FALSE and UNKNOWN can be returned.
About your question:
"Can a WHERE clause return NULL instead of TRUE or FALSE?"
Strictly speaking, in Oracle - NO , because such a result is called UNKNOWN.
But overall, the meaning of UNKNOWN and NULL is equivalent in this context, and it's just a different name for the same thing. So the SQL example below ( aa >= all ) evaluates to UNKNOWN.
with table_a as ( select null as a from dual union all select 10 as a from dual union all select 5 as a from dual), table_b as ( select null as a from dual union all select 10 as a from dual union all select 5 as a from dual) select * from table_a a where aa >= all(select a from table_b b)
source share