mysql
分组之后排序
https://blog.youkuaiyun.com/github_26672553/article/details/50800835
select *
from tb k
where (
select count(*)
from tb
where k.分组字段=分组字段 and 你的排序字段>k.你的排序字段
) < 3
取前三
oracle可以使用
row_number()函数
mysql
分组之后排序
https://blog.youkuaiyun.com/github_26672553/article/details/50800835
select *
from tb k
where (
select count(*)
from tb
where k.分组字段=分组字段 and 你的排序字段>k.你的排序字段
) < 3
取前三
oracle可以使用
row_number()函数