更新时间:2023-02-06 18:06:32
尝试这样的事情(未经测试,因为我没有你的数据库表来测试......):
Try something like this (untested, since I don't have your database tables to test against...):
SELECT
sv.sID AS '@sID',
sv.docID AS 'docID',
(SELECT
value AS 'value'
FROM
dbo.docMVtext mv
WHERE
mv.sID = sv.sID
ORDER BY mv.value
FOR XML PATH (''), TYPE) AS 'To'
FROM
dbo.docSVsys sv
WHERE
sv.sID = '57'
ORDER BY
sv.sID
FOR XML PATH('Document')
这是否为您提供了您正在寻找的东西?您是否同意约翰和我的看法:这比 FOR XML EXPLICIT
...
Does that give you what you're looking for?? And don't you agree with John and me: this is much simpler than FOR XML EXPLICIT
.....