A scalar uncorrelated subquery is nested SQL that returns exactly one value without depending on the outer query. Used as a comparison expression, it lets a query filter rows against an aggregate or other single result. section 4.3 section 4.3.1
Find readings at maximum power
SELECT read_on, power FROM readings WHERE power = (SELECT max(power) FROM readings); The inner query produces the maximum power, and the outer query returns every reading matching it. The example returns five readings at 133,900 W.
Equality and inequality operators require a scalar result. For multirow results, use set comparisons such as IN, EXISTS, ANY, or ALL; use a correlated subquery when the inner value must vary by outer row. section 4.3.1 section 4.3
