34,591
社区成员
发帖
与我相关
我的任务
分享
select * from tb where not exists(select 1 from tb where name=t.name and logintime>t.logintime)
select b.* from
(select distinct name from tb) a
cross apply
(select top(1) * from tb where name = a.name order by logintime desc) b
select * from tb a
where not exists(select 1 from tb where name = a.name and logintime > a.logintime)