I need to do a big query, but I only want the latest records.
For a single entry I would probably do something like
SELECT * FROM table WHERE id = ?
what do you think about this?
select * from ( SELECT a.*, row_number() over (partition by a.id order by date desc) r FROM table a where ID IN $LIST ) WHERE r=1
i used it a lot on the past