-
-
Save anibihakeem/6e7104b0ca3a0e069539358f616b2a4e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT H.CustomerID, AVG(D.OrderQty) Avg_quantity, ROUND(AVG(D.LineTotal),2) AS Avg_Amount | |
| FROM Sales.SalesOrderHeader AS H | |
| JOIN Sales.SalesOrderDetail AS D ON H.SalesOrderID = D.SalesOrderID | |
| GROUP BY CustomerID | |
| ORDER BY Avg_Amount DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment