Skip to content
RED SAGSkills
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;
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions