sys_connect_by_path 用法

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

(SELECT num,REPLACE(MAX(sql0), ';', ',')
                         FROM (SELECT num, sys_connect_by_path(sql1, ';') AS sql0
                              FROM (SELECT num, sql1, rn, lead(rn) over(PARTITION BY num ORDER BY rn) rn1
                                       FROM (SELECT num, sql1, row_number() over(ORDER BY num, sql1 DESC) rn FROM tlsbk))
                              START WITH num = '1' AND rn1 IS NULL
                               CONNECT BY rn1 = PRIOR rn));