同事教给偶的sql server 2005里的rank() over
李家佳(李家佳) 12:18:37
select * from
(
select username,SectionID,ExpertPoint, rank() over(partition by username order by ExpertPoint desc)
tt from [UserSectionProfiles] where UserName in
('ghj1976','daisy8675')
select * from
(
select username,SectionID,ExpertPoint, rank() over(partition by username order by ExpertPoint desc)
tt from [UserSectionProfiles] where UserName in
('ghj1976','daisy8675')
) xx where xx.tt between 2 and 3
否则要写一个很麻烦的子查询。先记下,回头再补充全