您的位置:首页 > 其它

查询无限极分类下的所有子节点

2012-10-18 13:52 246 查看
create function [dbo].[f_getDOWN](@id int)
returns @re table(id int)
as
begin
insert into @re select id from tb_productclass where id=@id
while @@rowcount>0
insert into @re select a.id
from tb_productclass a inner join @re b on a.FatherId=b.id
where a.id not in(select id from @re)
return
end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: