34,591
社区成员
发帖
与我相关
我的任务
分享
select * from tb a where not exists(select 1 from tb where ID=a.ID and 时间<a.时间)
select
*
from
(select id0=row_number()over(partition by id order by getdate(),* from tb)t
where
id0=1
select * from tb a where not exists(select 1 from tb where 姓名=a.姓名 and 时间<a.时间)