WITH recursive_query (id, unit_name,allpath,parentid ) AS (
SELECT t.id, t.unit_name,t.allpath,t.parentid
FROM t_unit t
WHERE t.id = '4028858b582cc56a01583d669266070d'
UNION ALL
SELECT c.id , c.unit_name,c.allpath,c.parentid
FROM t_unit c
JOIN recursive_query z ON c.id = z.parentid
)
SELECT t.*
FROM recursive_query t
oracle 递归查询返回all 行数据
最新推荐文章于 2024-11-11 17:55:29 发布