I have a table with many duplicate items – Many rows with the same id
, perhaps with the only difference being a requested_at
column.
I'd like to do a select *
from the table, but only return one row with the same id
– the most recently requested.
I've looked into group by id
but then I need to do an aggregate for each column. This is easy with requested_at
– max(requested_at) as requested_at
– but the others are tough.
How do I make sure I get the value for title
, etc that corresponds to that most recently updated row?