在Oracle9i中使用SYS_CONNECT_BY_PATH进行行列转换列出:(多行记录,显示在同一行)
SELECT max(SYS_CONNECT_BY_PATH (user_value, '//'))
FROM (SELECT user_value,ROWNUM parent, (ROWNUM + 1) CHILD
FROM tb_dt_app_param
WHERE lookup_type = 'AGENT_ID') tb
START WITH parent = 1
CONNECT BY PRIOR CHILD = parent
注意:START WITH ...CONNECT BY PRIOR ...是树形结构显示。
得到结果是:
content1//content2//content3//content4
阅读(825) | 评论(0) | 转发(0) |