例如数据 列Name
name
a
b
c
d
最后的结果
a*b*c*d*
declare @test table( namevarchar(10))
insert into @testvalues(\'a\'),(\'b\'),(\'c\'),(\'d\');
select distinct
(select cast(name asvarchar(2))+\'*\'from @test for xml path(\'\'))as name from @test
本文地址:https://www.stayed.cn/item/22006
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我