« first day (1619 days earlier)      last day (2699 days later) » 

11:19 AM
I have been trying to figure out a refactored SQL query for quite a while now, with no success. I have assets in one table, and revisions of those assets in another table. I have a list of asset ID's, and would like to get the latest revision (revision with the greatest ID) for all of those assets, using just one query.
I have this working in sqlite, but it does not work in mysql. And I'm not sure if it is the best way to do it anyway.
select asset_id
from (
    select `asset_id` from `revisions` where `asset_id` in (3, 7) order by `id` asc
) as `asd`
group by `asset_id`;
 

« first day (1619 days earlier)      last day (2699 days later) »