If you have problems, the grouping_id function will help you.
(You can choose grouping_id (col), but also grouping_id (col1, col2, col3, etc.))
But your case is simpler.
What is it like:
drop table fg_test_group; create table fg_test_group (a number, b number, c number, d number); insert into fg_test_group values (1, 2, 3, 4); insert into fg_test_group values (2, 2, 3, 4); insert into fg_test_group values (3, 2, 3, 4); select nvl(to_char(a), 'total') as a , sum(b), sum(c), sum(d), grouping_id(a) from fg_test_group group by rollup (a) ;
where a is the status in your case.
source share