SQL2005中的方法
create table tb(id int, value varchar(10))
insert into tb values(1, 'aa')
insert into tb values(1, 'bb')
insert into tb values(2, 'aaa')
insert into tb values(2, 'bbb')
insert into tb values(2, 'ccc')
go

select id, [value] = stuff((select ',' + [value] from tb t where id = tb.id for XML path('')) , 1 , 1 , '')
from tb
group by id

相关文章:

  • 2022-12-23
  • 2021-09-14
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-03-04
  • 2023-03-19
猜你喜欢
  • 2021-11-19
  • 2021-08-20
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案