Select most recent product purchase for each customer

machumpion

Registered User.
Local time
Today, 04:45
Joined
May 26, 2016
Messages
93
Let's say I have an Orders table (fields: customerID, productID, Date, revenue).
Customers can have purchased multiple different products throughout time. How can I query what the most recent product each customer purchased is?

THank you!

I also have a products table and customer table with details but I don't think it's relevant to this query.
 
Group by cust id and max() the date?
 

Users who are viewing this thread

Back
Top Bottom