34,588
社区成员
发帖
与我相关
我的任务
分享
select ID,MSG
from tb a
where not exists(select 1 from tb where ID=a.ID and DATE>a.DATE)
select id,max(msg) as msg
from [table]
group by id
SELECT * FROM tb a
WHERE NOT EXISTS (SELECT 1 FROM tb WHERE ID=a.ID AND MSG>a.MSG )