i'm using sql server 2008
ORDER BY [CustomerID]
This is the Orders table
I want to use the COUNT(*) function to get the count of Orders for each CustomerID.
How do I get the Count of orders for each CustomerID.
The result returned from the query should look lik this.
The first column would be the CustomerID and then the second column would be the count of Orders that customer had.
So then for example in the image below. ALFKI had 6 orders, ANATR 4 orders and so forth.