12.07.2015 Views

Module 13 (Introduction to SQL - Part 2).pdf

Module 13 (Introduction to SQL - Part 2).pdf

Module 13 (Introduction to SQL - Part 2).pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GroupingHere is an example that uses a WHERE clause anda GROUP BY clause:SELECT Cus<strong>to</strong>merID, ShipVia, Count(OrderID)AS OrderCount FROM OrdersWHERE Freight > 10.00GROUP BY Cus<strong>to</strong>merID, ShipViaHere, the WHERE clause explicitly subsets onlythose records where Freight > 10.00. TheGROUP BY and aggregation counts work off onlythat subset of records.

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

Saved successfully!

Ooh no, something went wrong!