Skip to Content
Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts
book

Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts

by John Adolph Palinski
August 2002
Intermediate to advanced content levelIntermediate to advanced
528 pages
10h 12m
English
Addison-Wesley Professional
Content preview from Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts

ROLLUP

ROLLUP is an extension or option available for the GROUP BY clause. It allows the user to compute subtotals and totals for groups of data. It is highly efficient and adds little overhead to the SELECT statement. A syntax template of the option is as follows:

				Group By rollup
				(expression1, expression2)
			

The ROLLUP keyword will cause a cumulative subtotal row to be created for each of the expressions. When multiple expressions are placed in the parameter list, Oracle will create a grand total for the right-most expression and a subtotal for each of the left-most expressions.

The ROLLUP rows can be identified by null values. The grand-total row will have only the grand-total values. All other row values will be null. If a subtotal is computed, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Expert PL/SQL Practices for Oracle Developers and DBAs

Expert PL/SQL Practices for Oracle Developers and DBAs

John Beresniewicz, Adrian Billington, Martin Büchi, Melanie Caffrey, Ron Crisco, Lewis Cunningham, Dominic Delmolino, Sue Harper, Torben Holm, Connor McDonald, Arup Nanda, Stephan Petit, Michael Rosenblum, Robyn Sands, Riyaj Shamsudeen
Beginning Oracle SQL: for Oracle Database 12c, Third Edition

Beginning Oracle SQL: for Oracle Database 12c, Third Edition

Lex De Haan, Tim Gorman, Inger Jørgensen, Melanie Caffrey

Publisher Resources

ISBN: 0201752948Purchase book