分析函数可以按两列分组么 比如一个表 a b c 字段
我想取a列数据一样的b列数据前10条,10条b列数据中的b列数据一样的c列数据前3条
------解决方案--------------------
select t2.a, t2.b, t2.c
from (select t1.a,
t1.b,
t1.c,
row_number() over(partition by a, b order by c) rn
from (select t.*, row_number() over(partition by a order by b) rn
from t) t1
where rn <= 10)t2
where t2.rn<=3;