Hacker News new | ask | show | jobs
by tacosbane 1370 days ago
postgres has window functions but it does not have the `qualify` clause.
1 comments

True, but you can simulate it by running the query with the window function in a CTE and then make a separate SELECT with the appropriate WHERE clause. More verbose, but the same effect and result. Using NOT MATERIALIZED on the CTE can also potentially let the planner do better query optimization on it.