create proc 过程名
@参数 int
as
declare @tmp1 table (ID int,ParID int)
insert @tmp1 select ID,ParID from Node where ID= @参数while exists(select 1 from Node a,@tmp1 b where a.ParID=b.ID and a.ID not in (select ID from @tmp1))
insert @tmp1 select a.id,a.parid from Node a,@tmp1 b where a.ParID=b.ID and a.ID not in (select ID from @tmp1)select sum([money]) 结果 from item where Nodeid in (select id from @tmp1)
@参数 int
as
declare @tmp1 table (ID int,ParID int)
insert @tmp1 select ID,ParID from Node where ID= @参数while exists(select 1 from Node a,@tmp1 b where a.ParID=b.ID and a.ID not in (select ID from @tmp1))
insert @tmp1 select a.id,a.parid from Node a,@tmp1 b where a.ParID=b.ID and a.ID not in (select ID from @tmp1)select sum([money]) 结果 from item where Nodeid in (select id from @tmp1)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货