关于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
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