17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3: The Foundation Statements of T-<strong>SQL</strong><br />

56<br />

our first 10 customers. We can use both the SalesPersonID and CustomerID columns in our GROUP BY.<br />

(I’ll explain how to use the COUNT() function shortly):<br />

SELECT CustomerID, SalesPersonID, COUNT(*)<br />

FROM Sales.SalesOrderHeader<br />

WHERE CustomerID

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!