Sql server 逗号隔开列数据字符串

declare @output varchar(8000)
select @output=coalesce(@output,'')+ Convert(varchar(50),CityId)+','
from AreMSCrm_ChannelDistributionByCity_Temp
select @output=substring(@output,1,len(@output)-1)
print @output

posted @ 2012-07-01 16:46  刘满意  阅读(726)  评论(0编辑  收藏  举报