![](http://ww1.sinaimg.cn/mw690/005PoOyugw1euzpw8jdw9j30h40g943k.jpg)
declare @result varchar(255)
set @result = ”
select @result = @result + cast(F_IT_FWID as varchar(255)) +‘,’
from [TJFX].[dbo].[TB_JG_SJTJFXB201412]
where F_IT_FWLX=1
select left(@result,len(@result) – 1) as fwid
declare @result varchar(255)
set @result = ”
select @result = @result + cast(F_IT_FWID as varchar(255)) +‘,’
from [TJFX].[dbo].[TB_JG_SJTJFXB201412]
where F_IT_FWLX=1
select left(@result,len(@result) – 1) as fwid
转载于:https://www.cnblogs.com/mabelhua/p/7477685.html