怎么用[^]相加
例:
id value----------------------------------------------------1 22 43 8
declare @str varchar(20)set @str='';with tas(select 1 as id,2 as valueunion allselect 2 ,4union allselect 3,8)select @str=@str+'^'+ltrim(value) from tselect right(@str,len(@str)-1) as valuevalue2^4^8
[解决办法]
declare @str int;with tas(select 1 as id,2 as valueunion allselect 2 ,4union allselect 3,8)select @str=isnull(@str,0)^value from tselect @str/*-----------14(1 行受影响)*/