如果select语句中有多个字段,并且希望通过优化代码获得所有这些字段的最新值:
select * from (select * from table_name order by id,rev desc) temp group by id