标签:style color io ar 数据 sp art c on
SELECT a.*
FROM tablename a
WHERE NOT EXISTS (SELECT 1 FROM tablename b WHERE b.Fid = a.id)
START WITH Fid = 0 CONNECT BY PRIOR id=a.Fid;
常用的做法:
id in (SELECT a.id
FROM tablename a
WHERE NOT EXISTS (SELECT 1 FROM tablename b WHERE b.Fid = a.id)
START WITH Fid = 0 CONNECT BY PRIOR id=a.Fid)
7. Orcle树形结构(类似数据字典有父子类关系),查询末节点的所有记录
标签:style color io ar 数据 sp art c on
原文地址:http://www.cnblogs.com/zkx4213/p/4001389.html