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

Create successful ePaper yourself

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

Aggregate FunctionsFor this type of query, the aggregate functions arespecified as usual (often with AS phrases <strong>to</strong> give aname <strong>to</strong> the results), and one or more ordinarycolumns (fields) are specified as well. Theordinary columns must then also appear in theGROUP BY clause.SELECT Cus<strong>to</strong>merID, Count (OrderID) ASOrderCount FROM OrdersGROUP BY Cus<strong>to</strong>merID

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

Saved successfully!

Ooh no, something went wrong!