oracle 递归查询整个路径并行转列组合成字符串

前端之家收集整理的这篇文章主要介绍了oracle 递归查询整个路径并行转列组合成字符串前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

递归查询路径:

select * from t_db_organize connect by prior fartherid=id start with id='139312' order by id asc

行转列:

select replace(wm_concat(to_char(name)),',',' > ') name from(select * from t_db_organize connect by prior fartherid=id start with id='139312' order by id asc);

wm_concat:行转列,默认逗号分隔,中文会乱码,使用to_char可以避免

原文链接:https://www.f2er.com/oracle/205832.html

猜你在找的Oracle相关文章