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(")"),
  )
)
ParameterTypeRequiredDescription
exprEXPRESSIONYesBoolean condition to evaluate
over_clauseOVER CLAUSEYesOVER (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
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19