I\'m pulling data from a database and one of the tables contain two columns that together identify a location and another column containing a date of each time it was servic
Try
select category_a, category_b, max(date) as last_update from table group by category_a, category_b
SELECT
category_a,
category_b,
MAX(date)
FROM
Some_Unnamed_Table
GROUP BY
category_a,
category_b
ORDER BY
category_a,
category_b
I certainly don't mind helping people when I can, or I wouldn't be on this site, but did you really search for an answer for this before posting?
select category_a, category_b, max( date) from tbl group by category_a ,category_b;
This is a simple "group by" using the fact the the "most recent" date is the "highest valued", or max()
, date
select category_a, category_b, max(date)
from mytable
group by category_a, category_b
order by category_a, category_b -- The ORDER BY is optional, but the example data suggests it's needed