Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime
Returns true if all values in expr are true within the group. This function is a synonym for bool_and aggregate function.
Syntax
every(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 every(col) FROM VALUES (true), (true), (true) AS tab(col);
true
> SELECT every(col) FROM VALUES (NULL), (true), (true) AS tab(col);
true
> SELECT every(col) FROM VALUES (true), (false), (true) AS tab(col);
false
> SELECT every(col1) FILTER(WHERE col2 = 1)
FROM VALUES (true, 1), (false, 2), (true, 1) AS tab(col1, col2);
true