條件:部門ID
結果:傳回所有該部門下的子部門集合
with hgo as( select *,0 as rank from TDEPT t where t.cid='"+id+"' union all select h.*,h1.rank+1 from TDEPT h join hgo h1 on h.cpid=h1.cid ) select * from hgo"
條件:部門ID
結果:傳回所有該部門下的子部門集合
with hgo as( select *,0 as rank from TDEPT t where t.cid='"+id+"' union all select h.*,h1.rank+1 from TDEPT h join hgo h1 on h.cpid=h1.cid ) select * from hgo"