问题描述
解决方案
select max(historyworkitemid) from table group by iworkitemid就可以了,先分组,每个分组中取最大的。
解决方案二:
select * from
(select iworkitemid, max(historyworkitemid) mid from table group by iworkitemid) newtab , table
where newtab.mid=table.historyworkitemid and newtab.iworkitemid=table.iworkitemid;
时间: 2025-01-21 18:07:25