SQL-xml(查询结果,多行合并成一行)

原始数据:

select  UserName  from com_t_userinfo where username like '测试%'

查询结果:

 

需求所要结果:

select   UserName+','  from com_t_userinfo where username like '测试%' for xml path ('')  

查询结果:

posted @ 2015-01-06 15:03  初薰  阅读(564)  评论(0)    收藏  举报