Read Using SQL Snippets ™ before using any of this site's sample code or techniques on your own systems.

Grouping Rows with GROUP BY

Cleanup

Run the code on this page to drop the sample tables, procedures, etc. created in earlier parts of this section. To clear session state changes (e.g. those made by SET, COLUMN, and VARIABLE commands) exit your SQL*Plus session after running these cleanup commands.