如何把数组02 03 05 06 18 30转换为字符02,03,05,06,18,30
现在有个数据表里有1107568条数组,例如
02 03 05 06 18 30
09 13 20 22 24 32
02 10 19 22 24 32
01 07 10 11 13 32
01 02 07 15 19 20
03 10 15 17 20 32
06 10 12 13 17 20
02 06 08 20 24 30
05 15 18 27 29 32
02 04 08 13 14 33
03 05 07 16 22 27
01 12 22 24 28 31
06 08 12 24 27 31
04 21 23 24 30 31
07 13 17 26 32 33
06 07 10 12 15 21
07 16 26 27 29 31
传换成以下格式
02,03,05,06,18,30
09,13,20,22,24,32
02,10,19,22,24,32
01,07,10,11,13,32
01,02,07,15,19,20
03,10,15,17,20,32
06,10,12,13,17,20
02,06,08,20,24,30
05,15,18,27,29,32
02,04,08,13,14,33
03,05,07,16,22,27
01,12,22,24,28,31
06,08,12,24,27,31
04,21,23,24,30,31
07,13,17,26,32,33
06,07,10,12,15,21
07,16,26,27,29,31
求大师指点用SQL语句完成转换。
【数据表是[master].[dbo].[33选6组合数AA],有1107568条数组,都需要转换。】
------解决方案--------------------select replace(column,' ',',') from tb
------解决方案--------------------如果表是六列:
select col1+','+col2+','+col3+','+col4+','+col5+','+col6 as col
from [master].[dbo].[33选6组合数AA]
如果只有一列:
select replace(col,' ',',') as col
from [master].[dbo].[33选6组合数AA]