a guest Jun 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT oh.SalesPersonID AS perID,
  2.        YEAR(oh.OrderDate) AS [Year], COUNT(*)
  3. FROM Sales.SalesOrderHeader oh
  4. JOIN Person.Person per ON oh.SalesPersonID = per.BusinessEntityID
  5. GROUP BY SalesPersonID, YEAR(OrderDate)
  6. ORDER BY perID, [Year];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand