Oracle 在分组的同时,取每个分组的前几条PARTITION BY select * from ( SELECT b,c,row_number() OVER( PARTITION BY b ORDER BY c desc) e FROM test_abc) t where e <= 3