fbpx

Highest Date Per Group

Another interesting question one of my students has sent me recently. Given the following Orders table. As you can see, this table has four columns : customer number, supplier number, order number, and order date.

image

Create a query to display the highest order date for each customer. For example, using the values shown above, the query will retrieve the following result:

image

UpScale Analytics is one of the largest platforms in the world for learning SQL by doing, consisting over 300 SQL exercises at different levels (including solutions), by topics, across over 100 different datasets. More…