FROM Categories
WHERE categoryID > 6 FOR XML EXPLICIT
2.连接查询
在EXPLICIT模式下的多表连接查询可能相对比较复杂些,先来看一个简单的例子,
查询语句:
SELECT 1 AS Tag,NULL AS Parent,
Categories.CategoryID AS [Category!1!ID],
Categories.CategoryName AS [Category!1!!element],
ProductID AS [Category!1!ProductID!element],
ProductName AS [Category!1!ProductName!element]
FROM Categories
JOIN Products ON Categories.CategoryID = Products.CategoryID AND ProductID <5
文章来源于领测软件测试网 https://www.ltesting.net/