db2递归查询
查询机构14159下的所有子孙节点
WITH n(orgid,orgupid,orgname) AS( SELECT SYS_ORG_ID,SYS_ORG_UPID,SYS_ORG_NAME FROM SYS_ORG_TB WHERE SYS_ORG_ID=14159 UNION ALL SELECT t2.SYS_ORG_ID,t2.SYS_ORG_UPID,t2.SYS_ORG_NAME FROM n t1,SYS_ORG_TB t2 WHERE t1.orgid=t2.SYS_ORG_UPID ) SELECT * FROM n