select * from table_name a where
4>(select count(*) from table_name where gid=a.gid and col2>a.col2)
order by a.gid,a.col2 desc
查询第三大值:select A, max(B) as thirdB from testwhere B not in (select top 2 B from test order by B desc)
group by A
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)