在存储过程中如何将Select出来的char字段每行相加连成字符串
如:
Select A from TBL_M
选出很多行:
现在要将这些行组成字符串:ffddssaabbcc
Select A from TBL_M
选出很多行:
A |
ff |
dd |
ss |
aa |
bb |
cc |
declare @n nvarchar(4000)
select @n=''
select @n=@n+A from TBL_M
select @n
select @n=''
select @n=@n+A from TBL_M
select @n