码迷,mamicode.com
首页 > 数据库 > 详细

关于SQL Server将一列的多行内容拼接成一行,合并显示在另外表中

时间:2017-11-09 11:22:37      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:bsp   tle   多行   select   合并   where   from   XML   rom   

 

 select ‘[‘+title_a+‘,‘+title_b +‘]‘ from A   for xml path(‘‘)

SELECT *, (select ‘[‘+title_a+‘,‘+title_b +‘]‘ from A where A.t_id=B.t_id   for xml path(‘‘))  FROM B

关于SQL Server将一列的多行内容拼接成一行,合并显示在另外表中

标签:bsp   tle   多行   select   合并   where   from   XML   rom   

原文地址:http://www.cnblogs.com/cuozhixu/p/7807946.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!