qzsee opened a new pull request, #40048: URL: https://github.com/apache/doris/pull/40048
## Proposed changes like bigquery https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#qualify_clause Examples ```sql SELECT item, RANK() OVER (PARTITION BY category ORDER BY purchases DESC) as rank FROM Produce WHERE Produce.category = 'vegetable' QUALIFY rank <= 3 /*---------+------* | item | rank | +---------+------+ | kale | 1 | | lettuce | 2 | | cabbage | 3 | *---------+------*/ ``` You don't have to include a window function in the SELECT list to use QUALIFY. The following query returns the most popular vegetables ```sql SELECT item FROM Produce WHERE Produce.category = 'vegetable' QUALIFY RANK() OVER (PARTITION BY category ORDER BY purchases DESC) <= 3 /*---------* | item | +---------+ | kale | | lettuce | | cabbage | *---------*/ ``` Issue Number: close #xxx <!--Describe your changes.--> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org