Summary

Team-Fly    

 
Sams Teach Yourself SQL in 24 Hours, Third Edition
By Ronald R. Plew, Ryan K. Stephens
Table of Contents
Hour  10.  Sorting and Grouping Data


You have learned how to group the results of a query using the GROUP BY clause. The GROUP BY clause is primarily used with aggregate SQL functions like SUM, AVG, MAX, MIN, and COUNT. The nature of GROUP BY is like that of ORDER BY in that both sort query results. The GROUP BY clause must sort data to group results logically, but can also be used exclusively to sort data, although an ORDER BY is much simpler for this purpose.

The HAVING clause, an extension to the GROUP BY clause, is used to place conditions on the established groups of a query. The WHERE clause is used to place conditions on a query's SELECT clause. During the next hour, you learn a new arsenal of functions that allow you to further manipulate query results.


Team-Fly    
Top
 


Sams Teach Yourself SQL in 24 Hours
Sams Teach Yourself SQL in 24 Hours (5th Edition) (Sams Teach Yourself -- Hours)
ISBN: 0672335417
EAN: 2147483647
Year: 2002
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net