9 ms·
postgres has window functions but it does not have the `qualify` clause.
by tacosbane 4y ago
postgres has window functions but it does not have the `qualify` clause.
- ttfkam 4y agoTrue, 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.