您的位置:首页 > 数据库

SQL-根据id合并多行字段数据

2018-03-01 16:28 232 查看
SELECT
sampleid,
testitem = STUFF(
(
SELECT
',' + testitem
FROM
t_order_testitem AS t
WHERE
t.sampleid = t_order_testitem.sampleid FOR xml path ('')
),
1,
1,
''
)
FROM
t_order_testitem
GROUP BY
sampleid
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  SQL
相关文章推荐