------解决方案-------------------- select a.* from table a where not exists(select 1 from table b where b.id = a.id and b.stsdt > a.stsdt)
------解决方案-------------------- 1楼正解,让我想起来删除重复数据的方法
------解决方案-------------------- ()里面貌似取不到表的别名a的吧?
------解决方案-------------------- select * from (select A.*, row_number() over(partition by id order by stsdt desc) AS SHOW from 表 as A ) b where b.SHOW = 1