我在SQlCompact数据库中使用了一个T-Sql,但它无法正常工作,而stuff()
用于在单元格中收集值。
这是select语句,但它显示错误:
SELECT Pepole.ID, Pepole.FNA, Pepole.LNA, STUFF
((SELECT ', ' + Name AS Expr1
FROM Special AS S2
WHERE (ID = PeopleTarget_1.SpecialID) FOR XML PATH('')),,,) AS Names
FROM Pepole INNER JOIN
PeopleTarget AS PeopleTarget_1 ON Pepole.ID = PeopleTarget_1.PeopleID INNER JOIN
Special AS Special_1 ON PeopleTarget_1.PeopleID = Special_1.ID