Skip to content

Instantly share code, notes, and snippets.

@anibihakeem
Last active December 14, 2023 10:40
Show Gist options
  • Select an option

  • Save anibihakeem/672869670db79b9a2b446ff7369e24e2 to your computer and use it in GitHub Desktop.

Select an option

Save anibihakeem/672869670db79b9a2b446ff7369e24e2 to your computer and use it in GitHub Desktop.
SELECT FORMAT(OrderDate,'MMMM') as Order_Month, COUNT(D.SalesOrderID) Order_Count
FROM Sales.SalesOrderHeader AS H
JOIN Sales.SalesOrderDetail AS D
ON H.SalesOrderID = D.SalesOrderID
GROUP BY FORMAT(OrderDate,'MMMM')
ORDER BY Order_Count DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment