linyuansun

with
temp00 as (
select
\'1\' id,
\'zhangsan\' name,
\'gaoshu\' cla,
\'3\' num  
select
\'2\' id,
\'lisi\' name,
\'gaoshu\' cla,
\'2\' num
union all
select
\'2\' id,
\'lisi\' name,
\'jingji\' cla,
\'4\' num
union all
select
\'3\' id,
\'wangwu\' name,
\'gaoshu\' cla,
\'3\' num
union all
select
\'3\' id,
\'wangwu\' name,
\'wuli\' cla,
\'3\' num )


select
id,
stuff(
(select \',\' + name from  temp00 where id = a.id for xml path(\'\'))
,1,1,\'\') as names --这个函数
from temp00 a
group by
id

分类:

技术点:

相关文章:

  • 2021-04-26
  • 2022-01-25
  • 2021-12-13
  • 2022-01-12
  • 2021-09-03
  • 2021-11-30
  • 2023-02-02
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-12-28
  • 2021-11-27
  • 2022-01-30
  • 2021-12-14
  • 2022-01-09
相关资源
相似解决方案