xml path

来源:互联网 发布:日料 知乎 编辑:程序博客网 时间:2024/06/07 20:16
 

create table myT

(
 
id int identity(1,1) primary key
 
,name varchar(20)

)
insert into myT values('lee1')

insert into myT values('lee2')

insert into myT values('lee3')

insert into myT values('lee4')
insert into myT values('lee5')

insert into myT values('lee6')

 


select (select convert(varchar(5),id) + ','   from myT for xml path('') ) as ids

原创粉丝点击