Skip to content

bool_and ​

Return whether every non-NULL boolean input is true.

Syntax

text
bool_and(value) [FILTER (WHERE ...)]

Arguments

Bool-convertible values: true, false, 0, 1, and corresponding text; other values error; Aggregate DISTINCT, FILTER, ORDER BY and ordinary windows are supported.

Returned value

Native Bool, or NULL for no non-NULL inputs.

Examples

sql
CREATE TABLE checks (passed Bool);
INSERT INTO checks VALUES (true),(false),(NULL);
sql
SELECT bool_and(passed) FROM checks FORMAT csv;
text
false