日期:2014-05-18 浏览次数:20612 次
declare @str varchar(20) set @str='' select @str=@str+','+LTRIM(a01) from A select RIGHT(@str,LEN(@str)-1) as new
------解决方案--------------------
declare @A table (a01 varchar(32))
insert @a select 'aa' union all select '34' union all select 'b1'
declare @str varchar(20)
set @str=''
select @str=@str+','+LTRIM(a01) from @A
select RIGHT(@str,LEN(@str)-1) as new
/*
new
aa,34,b1
*/