Question: Code example 5 - 1 SELECT VendorState, VendorCity, VendorName, COUNT ( * ) AS InvoiceQty, SUM ( InvoiceTotal ) AS InvoiceAvg FROM Invoices i JOIN
Code example
SELECT VendorState, VendorCity, VendorName, COUNT AS InvoiceQty,
SUMInvoiceTotal AS InvoiceAvg
FROM Invoices i
JOIN Vendors v
ON iVendorID vVendorID
WHERE VendorState e
GROUP BY VendorState, VendorCity, VendorName
HAVING SUMInvoiceTotal
ORDER BY VendorState, VendorCity, VendorName;
The GROUPING SETS operator works like the ROLLUP and CUBE operators, but it
a excludes summary rows
b doesnt add summary rows for specified groups
c allows you to use additional sets of parentheses to create composite groups
d only works with tables that have an even number of rows
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
