首页 > 代码库 > sql 表中列值转成字符串

sql 表中列值转成字符串

DECLARE @STR VARCHAR(8000)
SELECT @STR=ISNULL(@STR+‘,‘,‘‘)+weixinuser FROM (SELECT DISTINCT weixinuser FROM v_sysbinduser)AS T
SELECT @STR
 
declare @output varchar(8000)
select @output = coalesce(@output + ‘,‘ , ‘‘) + weixinuser from v_sysbinduser
print @output