--树形sql查询
WITH TREE AS( --创建一个虚拟表
SELECT * FROM sys_organiz --指定需要查询的表
WHERE organize_code = '100000' -- 指定父节点条件
UNION ALL --联合查询
SELECT sys_organiz.* FROM sys_organiz,TREE
WHERE TREE.organize_code = sys_organiz.organize_parent_code
)
SELECT * FROM TREE;