A为分集字段,B为集内排序字段
典型案例:
找出某个日期每个营业部内资产数额排名前两位的顾客
select * from (select rank() over(partition by branch_no order by asset desc) rk,account,asset from aa.asset) where rk<=2
select * from (select rank() over(partition by branch_no order by asset desc) rk,account,asset from aa.asset) where rk<=2