我正在阅读一本 SQL 基础教科书,下面是 T-SQL 代码:
SELECT Customer.custid AS [@custid],
Customer.companyname AS [companyname]
FROM Sales.Customers AS Customer
WHERE Customer.custid <= 2
ORDER BY Customer.custid
FOR XML PATH ('Customer'), ROOT('Customers');
谁能告诉我使用 PATH 的意义,以及为什么在 custid 之前有一个 @?
欢迎任何建议,谢谢