bool_and
aggregate function
Applies to: Databricks SQL Databricks Runtime
Returns true if all values in expr
are true within the group.
Syntax
bool_and(expr) [FILTER ( WHERE cond ) ]
This function can also be invoked as a window function using the OVER
clause.
Arguments
expr
: A BOOLEAN expression.cond
: An optional boolean expression filtering the rows used for aggregation.
Returns
A BOOLEAN.
Examples
> SELECT bool_and(col) FROM VALUES (true), (true), (true) AS tab(col);
true
> SELECT bool_and(col) FROM VALUES (NULL), (true), (true) AS tab(col);
true
> SELECT bool_and(col) FROM VALUES (true), (false), (true) AS tab(col);
false
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for