求一个无限级树型结构
树型结构是存储商品分类的
[解决办法]
- SQL code
with cte as( select id from tb where pid=@id union all select a.id from tb a join cte b on a.id=b.pid)select * from cte
发布时间: 2012-07-30 16:19:05 作者: rapoo
求一个无限级树型结构
树型结构是存储商品分类的
[解决办法]
with cte as( select id from tb where pid=@id union all select a.id from tb a join cte b on a.id=b.pid)select * from cte