select * from Tablea a
where (select count(1) from Tablea where columna= a.columna and columnb>=a.columnb)<=N
order by columna,columnb desc
Sql 子查询 实现分组 显示 TOP N
最新推荐文章于 2022-10-11 12:02:33 发布
select * from Tablea a
where (select count(1) from Tablea where columna= a.columna and columnb>=a.columnb)<=N
order by columna,columnb desc