标签:from fine member color type class parent sele style
WITH cte_name AS ( --Anchor member is defined select PCY_Name,PCY_ID,PCY_Parent,PCY_Code,PCY_Status from PB_Code_MaterType where PCY_ID=‘2001001001000000‘ UNION ALL --Recursive member is defined referencing cte_name select a.PCY_Name,a.PCY_ID,a.PCY_Parent, a.PCY_Code,a.PCY_Status from PB_Code_MaterType a inner join cte_name c on a.PCY_Parent=c.PCY_ID ) -- Statement using the CTE SELECT *,(select PCY_Name from PB_Code_MaterType where PCY_ID=cte_name.PCY_Parent)PCY_ParentTxt FROM cte_name
标签:from fine member color type class parent sele style
原文地址:https://www.cnblogs.com/lystory/p/9675350.html