SELECT
SalesOrder.OrderDate
, Customers.CustomerName
, SalesOrder.OrderID
, Product.StockItemName
, LineItem.Quantity
, LineItem.UnitPrice
FROM Sales.Orders SalesOrder
INNER JOIN Sales.OrderLines LineItem
ON LineItem.OrderID = SalesOrder.OrderID
INNER JOIN Warehouse.StockItems Product
ON Product.StockItemID = LineItem.StockItemID
INNER JOIN Sales.Customers Customers
ON Customers.CustomerID = SalesOrder.CustomerID
WHERE customers.CustomerName = 'Agrita Abele'
FOR XML RAW ;
If we were to add a FOR XML clause using RAW mode, the results would be returned in the form of an XML fragment. The amended query in Listing will return the XML document, instead of a relational result set.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.