Possible Duplicate:
Fetch the row which has the Max value for a column
My table looks like the following:
Sales
- id
- country_id
- location_id
- order_id
- created
Now I want only a single row to be returned (the latest, which can be either using the highest id value or using the datetime field created) for each country_id, location_id pair.
Is this possible in a single query?