COUNT_IF() OVER ...
All functions > WINDOW FUNCTION > COUNT_IF() OVER ...
Returns the count of rows where the condition is true in the window frame.
Syntax
Diagram(
Sequence(
Terminal("COUNT_IF"),
Terminal("("),NonTerminal('expr'),Terminal(")"),
Terminal("OVER"),
Terminal("("),
NonTerminal("over_clause"),
Terminal(")"),
)
)| Parameter | Type | Required | Description |
|---|---|---|---|
expr | EXPRESSION | Yes | Boolean condition to evaluate |
over_clause | OVER CLAUSE | Yes | OVER (PARTITION BY ... ORDER BY ... [FRAME ...]) |
Notes
- Counts rows where the boolean expression evaluates to true
- NULL values are treated as false
- Always returns BIGINT type
- Equivalent to COUNT(*) FILTER (WHERE condition) in standard SQL