Identify the available group functions.
The aggregating functions include: AVG COUNT FIRST LAST MAX MIN STDDEV SUM VARIANCE
Describe the use of group functions.
The group functions allow you to calculate aggregate statistics over several rows in a table. They return a single result based on many rows. Analytic functions are similar but less used and potentially more powerful.
Group data by using the GROUP BY clause.
SELECT DECODE(SIGN(year-1999),1,year,'1999 or before'), SUM(result) FROM grp_test GROUP BY DECODE(SIGN(year-1999),1,year,'1999 or before');
This SQL takes a table of years and results, and sums every thing before 2000 in one column while listing all the values from 2000 and newer. Very clever, by Michel Cadot in comp.databases.oracle.server
Include or exclude grouped rows by using the HAVING clause.
SELECT table_name, COUNT(*) FROM all_indexes GROUP BY table_name HAVING COUNT(*) BETWEEN 2 AND 3;
Here we using having to limit the select values to those table that have between 2 and 3 indexes.