with myCte as ( select * from RS_Comment where id=10000004 union all select RS_Comment.* from RS_Comment inner join myCte on RS_Comment.ParantID=myCte.id )select * from myCte
递归查询所有子集,布布扣,bubuko.com
递归查询所有子集
原文:http://www.cnblogs.com/huweijun/p/3880096.html