select * from table as a inner join ( select MAX(dtmcreateDate) as datetimes,lngExposureID from table group by lngExposureID ) as b on a.lngExposureID = b.lngExposureID and a.dtmcreateDate = b.datetimes
思路:根据类型group,取出最新时间数据,在根据联合主键查询出其他列
时间: 2024-10-06 13:06:45