日期:2014-05-17 浏览次数:20503 次
DECLARE @arrChildID NVARCHAR(50) select @arrChildID=isnull(@arrChildID+','.'')+nodeid from nodes where ParentID=1 select @arrChildID
------解决方案--------------------
DECLARE @arrChildID NVARCHAR(50)
select @arrChildID =rtrim(nodeid)+','+@arrChildID from nodes where ParentID=1
update .........set A=@arrChildID
------解决方案--------------------
create table nodes( nodeid varchar(10)) insert into nodes select '12' union all select '15' union all select '18' union all select '20' union all select '25' declare @arrChildID varchar(500) select @arrChildID=isnull(@arrChildID+',','')+nodeid from nodes select @arrChildID update updated_tb set updated_col=@arrChildID
------解决方案--------------------