oracle生成path的sql语句

oracle生成path的sql语句
UPDATE "table" t1
SET t1. PATH = (
SELECT
‘/-1‘ || SYS_CONNECT_BY_PATH (id, ‘/‘) PATH
FROM
"table" t2
WHERE
t2.id= t1.id

START WITH pid= ‘-1‘ CONNECT BY PRIOR id= pid

);

 

生成path


select id, pid, ‘/-1‘ || sys_connect_by_path(id, ‘/‘) path
from "table"
START WITH pid=‘-1‘
CONNECT BY PRIOR id= pid

oracle生成path的sql语句

上一篇:MySQL数据库多实例介绍及安装


下一篇:Oracle 11g RAC运维总结