\set ECHO none add_provenance (1 row) q|differences NULL key|0 (1 row) q|differences NULL key, other aggregates|0 (1 row) q|differences two keys, one NULL in turn|0 (1 row) q|differences NOT NULL key|0 (1 row) q|differences WHERE kept|0 (1 row) q|differences WHERE kept, NOT NULL key|0 (1 row) q|differences two DISTINCT aggregates|0 (1 row) q|differences sum(DISTINCT)|0 (1 row) q|differences no GROUP BY|0 (1 row) remove_provenance (1 row) q|g|p HAVING cd >= 1|1|0.8750 HAVING cd >= 1|2|0.5000 HAVING cd >= 1||0.7500 (3 rows) remove_provenance (1 row) q|g|p HAVING cd >= 1, WHERE|1|0.7500 HAVING cd >= 1, WHERE|2|0.5000 HAVING cd >= 1, WHERE||0.7500 (3 rows) remove_provenance (1 row) q|g|ec expected beside DISTINCT|1|1.333333 expected beside DISTINCT|2|1.000000 expected beside DISTINCT||1.333333 (3 rows) remove_provenance (1 row) q|present HAVING fails|f HAVING on another aggregate|t correlated, empty|f correlated, one value|t empty, HAVING holds|t scalar DISTINCT subquery, empty|f (6 rows)