Snowflake count_if returns 0 if no records satisfy the condition, while the documentation states otherwise
# Postmortem: Snowflake `COUNT_IF` Behavior vs. Documentation Discrepancy ## Summary – Snowflake’s `COUNT_IF` function returns `0` when no records meet the condition. – Official documentation claims it should return `NULL` in such cases. – Discrepancy confirmed via live testing of `COUNT_IF(1 != 1)` returning `0`. ## Root Cause – Implementation aligns with SQL’s `COUNT` aggregation … Read more