Back Practice ↓

Related Practice & In-Depth Concepts

↑ Read lesson

Task:We want to know the chronological order number of every purchase a user makes. Write a query that returns `user_id`, `order_date`, `total_amount`, and a calculated column named `purchase_number`. The `purchase_number` should use `ROW_NUMBER()` to number each user's orders sequentially starting from 1 based on the `order_date`.
SQL Query Editor
No results returned. Press Run Query (or Cmd/Ctrl + Enter) to execute.