CET递归
Posted lystory
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CET递归相关的知识,希望对你有一定的参考价值。
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
以上是关于CET递归的主要内容,如果未能解决你的问题,请参考以下文章