SQLDAXExcelPython
Leaderboard
Interview classicsMedium20 points

Latest row per customer

For each customer with sales, return CustomerId, SaleId and OrderDate of their latest sale. On a tie, take the highest SaleId.

Show solutionLifetime

Runs in your browser with DuckDB, whose SQL is close to PostgreSQL. Nothing you type is sent to a server unless you save a score.

SQLselect text to run only that part
Loading editor…

Press Ctrl+Enter or Run to see the result here.