Question: Rewrite the following code so it uses a common table expression (CTE) instead of a derived table. USE AdventureWorks2012; SELECT TOP 1 SUM(TotalDue) AS Invoice_total,
Rewrite the following code so it uses a common table expression (CTE) instead of a derived table.
USE AdventureWorks2012; SELECT TOP 1 SUM(TotalDue) AS Invoice_total, VendorID FROM Purchasing.PurchaseOrderHeader GROUP BY VendorID ORDER BY Invoice_total DESC
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
