Tuesday, 9 July 2013

Finding the most recent purchase by each customer with SQL

If you have transaction history such as purchases in a database (or really any list of items with timestamps), you frequently want to pick out recent items. SQL makes it easy to find the most recent items in the table.
The most recent items in the table
The most recent items in the table

Finding the most recent purchase by each customer with SQL | Metrica