取出分组之后每组前10条数据 oracle

前端之家收集整理的这篇文章主要介绍了取出分组之后每组前10条数据 oracle前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
--取出x || '_' || y分组之后每组前10条数据
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

猜你在找的Oracle相关文章