medium10 pts · first answer countswindow-functionssql
Latest row with DISTINCT ON
In PostgreSQL, what does this return?
SELECT DISTINCT ON (customer_id) customer_id, order_id, created_at FROM orders ORDER BY customer_id, created_at DESC;
Discussion 0
Join free to post in the discussion.