34,594
社区成员
发帖
与我相关
我的任务
分享
select *
from [table] a
where exists (
select 1 from (
select sid, max([Series No]) as maxSNo
from [table]
group by sid
) as b
where b.sid = a.sid and a.[Series No] = maxSNo
)
and not exists (
select 1 from [table] b
where b.sid = a.sid
and b.[Series No] = a.[Series No]
and b.Version > a.Version
)