Bloom Analytics on Medium: Snowflake Cliff Notes: QUALIFY Clause

Just starting out in Snowflake or already established, take a look at this article by Zakary LeBlanc discussing the QUALIFY clause and its use case. Check out the excerpt below:


Let’s take a quick look at the QUALIFY clause in Snowflake. Here’s the definition from Snowflake’s documentation:

In a SELECT statement, the QUALIFY clause filters the results of window functions.

QUALIFY does with window functions what HAVING does with aggregate functions and GROUP BY clauses.

To get a clear picture, it is best to see an example of how it is used in a query.

If you are coming to Snowflake from another relational database platform such as SQL Server or Oracle this may completely new to you. The QUALIFY clause is not part of the ANSI SQL standard and, as such, has not been implemented in most database platforms (a quick search online only showed it as being available in Snowflake, Teradata, and Azure Databricks)…


Read the rest here: Snowflake Cliff Notes: QUALIFY clause.

Leave a comment