SELECT COALESCE(ID, 'TOTAL') AS ID, Product, SUM(Quantity) AS TotalQuantity FROM Sales GROUP BY ROLLUP(ID, Product);
Here, Replaces NULL in the ID column with "TOTAL" in rolled-up rows. Helps create more meaningful outputs by avoiding NULLs in summary rows.