Aggregates
Aggregate
count_if()
Counts the total number of TRUE values for a boolean column
Arguments & returns
count_if(arg)
Aggregate
| Overload link | arg |
Returns |
|---|---|---|
| #01 | BOOLEAN |
HUGEINT |
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example with sample data · Run to view results.
In other engines
Snowflakecount_if()
SELECT COUNT_IF(x > 1) FROM t
SELECT COUNT_IF((x > 1) IS TRUE) FROM t