select * from (
select x,y,sj,ddbz,
row_number() over (partition by x || '_' || y order by sj desc) rn
from test
where x is not null and y is not null
) where rn <= 10
--行转列数据
select x|| '_' || y jdwd,wm_concat(distinct DDBZ) from( select * from ( select x,row_number() over (partition by x || '_' || y order by sj desc) rn from qb_gissj where x is not null and y is not null ) where rn <= 10) group by (x || '_' || y)
原文链接:https://www.f2er.com/oracle/210610.html