标签:
--递归查询 with cte as ( select a.ID,a.Text, a.Name,a.PID from Menu a where id=‘2‘ union all select k.id,k.Text, k.name,k.pid from Menu k inner join cte c on c.id = k.pid )select * from cte
sqlserver递归查询
原文地址:http://www.cnblogs.com/tiancai/p/4923738.html