Advanced Aggregation with ROLLUP

Published September 09, 2026 By Sai Sree Ram Gundepudi

Using ROLLUP

SELECT department, SUM(salary) 
FROM employees 
GROUP BY department WITH ROLLUP;

The NULL row shows the grand total.

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article