BOOL_AND

All functions > AGGREGATE > BOOL_AND

Returns true if all values in the group are true.

Syntax

BOOL_AND(expr, group_by, where)
sql

Arguments

ParameterTypeRequiredDescription
exprBOOLEANYesThe boolean expression to evaluate

Returns

TRUE if all values are TRUE, FALSE otherwise

Notes

  • Logical AND aggregation across all values in the group
  • Returns FALSE if any value is FALSE
  • Returns TRUE if all values are TRUE
  • NULL values are ignored in the calculation
  • Returns TRUE for empty groups (vacuous truth)
  • Can be used with WHERE clause to filter before aggregation
  • Can be used with GROUP BY clause for grouped aggregation

Examples

Last update at: 2025/10/13 10:23:46