DuckDB 2 · SQL features

Filter on a window function

QUALIFY filters rows after window functions are calculated, without a subquery.

SELECT * FROM sales QUALIFY row_number() OVER (PARTITION BY region ORDER BY amount DESC) = 1;

Official DuckDB 2 documentation

More sql features commands

All sql features commands · DuckDB 2 cheatsheet

Was this page helpful?