标签:
with cte as ( SELECT GroupId,PGroupId,GroupName,0 as lvl FROM T_Group_Info WHERE GroupId=29 union all select d.GroupId,d.PGroupId,d.GroupName,lvl+1 from cte c inner join T_Group_Info d on c.GroupId = d.PGroupId ) select * from cte
标签:
原文地址:http://www.cnblogs.com/jt789/p/5328477.html