BOOLEAN_OR_AGG
Purpose
BOOLEAN_OR_AGG returns 'TRUE' if the boolean_expr evaluates to true for at least one row that qualifies. Otherwise it returns 'FALSE'. You can use it as an aggregate or analytic function.
Examples
SELECT BOOLEAN_OR_AGG(c2)
FROM t;
SELECT BOOLEAN_OR_AGG(c2)
FROM t
WHERE c1 = 0;SELECT BOOLEAN_OR_AGG(c2)
FROM t
WHERE c2 IS TRUE;SELECT BOOLEAN_OR_AGG(c2)
FROM t
WHERE c2 IS TRUE OR c2 IS NULL;SELECT BOOLEAN_OR_AGG(c2)
FROM t
WHERE c2 IS NOT FALSE OR c2 IS NULL;SELECT BOOLEAN_OR_AGG(c2)
FROM t
WHERE c2 IS NOT TRUE OR c2 IS NULL;SELECT BOOLEAN_OR_AGG(c2 OR c2)
FROM t
WHERE c2 IS NOT TRUE OR c2 IS NULL;