sql 递归查询

来源:互联网 发布:程序员 武汉 杭州 编辑:程序博客网 时间:2024/06/11 10:57

sql 递归查询


with my1 as(

select  * from JTZK_Comment where Status=1 
 union all 
select JTZK_Comment.* from my1,JTZK_Comment where my1.ParentId = JTZK_Comment.id
)
select  DISTINCT * from my1;
1 0
原创粉丝点击