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

 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

猜你喜欢

转载自www.cnblogs.com/Jeremy2001/p/9096658.html