例如數(shù)據(jù) 列Name
復(fù)制代碼 代碼如下:
name
a
b
c
d
復(fù)制代碼 代碼如下:
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
復(fù)制代碼 代碼如下:
(4 row(s) affected)
name
--------------------------------------------------
a*b*c*d*
(1 row(s) affected)
新聞熱點
疑難解答
圖片精選