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-06-30 18:45:00 发布
select * from Tablea a
where (select count(1) from Tablea where columna= a.columna and columnb>=a.columnb)<=N
order by columna,columnb desc