SELECT cast(id as varchar(8)) new_id
  FROM tourol_Atractions
  where tcid>0 order by new_id
  
SELECT top 1 new_id = stuff
((SELECT ',' + cast(id as varchar(8))
FROM  tourol_Atractions
WHERE tcid>0 FOR xml path('')), 1, 1, '')
FROM [tourol_Atractions] where tcid>0

 

结果如下

SQL同列合并

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-11-17
猜你喜欢
  • 2021-12-10
  • 2021-11-23
  • 2022-01-25
  • 2022-12-23
  • 2022-02-28
  • 2022-01-30
  • 2022-12-23
相关资源
相似解决方案