I'd like to perform a select on a table involving a
GROUP BY such that all rows that share the same set of identifiers are grouped together, but I want to reduce the group to one of the grouped rows based on some criteria. For example, the maximum
date_added. However, there are other fields of data that could be different among the grouped rows. I want all of those columns to resolve to the row with the max
date_added as well.
I realize to get the max
date_added I could simply
SELECT MAX(date_added), but that is just a column-level aggregate function. Is there any way I can resolve the entire row in a group?
Conceptually, if you imagine each group as a separate table, I want to
SELECT * WHERE date_added=(SELECT MAX(date_added)) from that group table.