各位老师:在sql中下面的tableA变化为tableB怎么做?

2025-03-26 00:54:17
推荐回答(1个)
回答1:

with A as(select distinct p1 from tableA)
select p1,(select '%'+name from tableA where p1=A.p1 for XML path(''))+'%'
   from A