O'Reilly logo

OCA Oracle Database 11g: SQL Fundamentals I: A Real-World Certification Guide by Steve Ries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Grouping data

Clearly, the ability to do sums and averages with large amounts of business data is important. However, our previous examples have one significant limitation—the aggregated function operates on the entire table. Thus, we can see aggregation at one level, but if we want a more granular look at the data, we are forced to do a high degree of manual work breaking the data apart. For instance, we've seen an example of finding the average number of logins for all employees using the AVG() function. But, what if we wanted to see those averages on a different level? Say, the average number of logins differentiated between male and female employees? One way to do this is by utilizing two separate queries, using a WHERE clause to differentiate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required