newsea

 多行合并成一行.

declare @tab table (id int )
declare @i int
declare @str varchar(300)

select @i = 0 ,@str = \'[\'

while @i < 20 begin
    
insert into @tab
    
select @i
    
    
select @i = @i + 1 
end

select @str = @str + cast(id as varchar+ \',\'  from @tab
select @str =substring(@str,1,len(@str-1 ) + \']\'

select @str 


参见:
一行折分成多行: http://www.cnblogs.com/newsea/archive/2006/10/19/533285.html

分类:

技术点:

相关文章:

  • 2021-05-15
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案