Filter window results without wrapping a subquery.
Section: Dialect notes
QUALIFY shortcut in some warehouses
sql
sql
SELECT *
FROM orders
QUALIFY ROW_NUMBER() OVER (
PARTITION BY customer_id
ORDER BY created_at DESC
) = 1;Explanation
`QUALIFY` exists in engines like BigQuery and Snowflake, but not in every relational database.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Dialect notes
Portable alternative to QUALIFY
Use a subquery or CTE for broad compatibility.
Remember LAST_VALUE frame semantics
Default frames can make LAST_VALUE look broken.
Be explicit about NULL ordering when needed
Different engines may sort NULLs differently.
Create a supporting index for partition/order keys
Help the database read rows in the right order.