Instantly share code, notes, and snippets.

Embed
What would you like to do?
use AdventureWorks2012
go
SELECT AVG(JML_ORDER) AS "Average Sales Per Person" from
(
SELECT SalesPersonID, COUNT(*) as JML_ORDER
FROM Sales.SalesOrderHeader
WHERE SalesPersonID IS NOT NULL
GROUP BY SalesPersonID
) a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment