ROLLUP Function

Contact Us or call 1-877-932-8228
ROLLUP Function

ROLLUP Function

Code Sample:

Enhancing-Groups-With-Rollup-and-Cube/Demos/roll_up.sql
SELECT 
	region_name, 
	country_name,  
	count(*) 
FROM emp_details_view 
GROUP BY ROLLUP(region_name, country_name)
ORDER BY region_name, country_name;

By simply adding the ROLLUP function in the group by clause - totals are generated at the county and region levels.

Next