标签:
1.原始
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
标签:
原文地址:http://www.cnblogs.com/hamilton/p/5903386.html