1.原始
2.利用语句
SELECT B.tablename ,
LEFT(StuList, LEN(StuList) - 1) AS ArrayList
FROM ( SELECT tablename ,
( SELECT columnname + ‘,‘
FROM DataService
WHERE tablename = A.tablename
FOR
XML PATH(‘‘)
) AS StuList
FROM DataService A
GROUP BY tablename
) B
时间: 2024-10-11 15:51:23