Snowflake has an odd behavior when using a HAVING clause within a CTE definition that doesn't exist in other SQL dialects.
The Curious Case of a Snowflake CTE
Snowflake has an odd behavior when using a HAVING clause within a CTE definition that doesn't exist in other SQL dialects.