Skip to content
RED SAG Skills
easy5 pts · first answer countswindow-functionssql

Filtering on ROW_NUMBER in WHERE

This query fails in PostgreSQL. Why?

SELECT customer_id, order_date,
       ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date) AS rn
FROM orders
WHERE rn = 1;
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions