Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting a Grand total based on a specific column

Chandu VenuNov 1 2022

Hello,
Create TABLE T1_TEMP(Reason VARCHAR2(10), Jurisdiction Varchar2(10) Pre-Approval NUMBER, Pending NUMBER, Approved NUMBER, Denied NUMBER);
Insert into T1_TEMP VALUES ('Home','J5','0','1','4','0');
Insert into T1_TEMP VALUES('Office','J5','0','2','5','2');
Insert into T1_TEMP VALUES('Travel','J5','0','3','7','1');
Insert into T1_TEMP VALUES('Home','J6','1','0','1','0');
Insert into T1_TEMP VALUES('Office','J6','1','0','2','0');
Oracle DB Version: Oracle 19c (Enterprise Edition Release 19.0.0.0.0)

Currently, when I query against the above table - T1_TEMP, I have the data in this format:

image.pngI am trying to get a grand total of Pre-Approval, Pending, Approved and Denied for each Jurisdiction.
Expected Result:
image.pngAt the end of each Jurisdiction, I need a grand total of the categories.

Any help or suggestions would be greatly appreciated. Thank you!!!

This post has been answered by mathguy on Nov 1 2022
Jump to Answer
Comments
Post Details
Added on Nov 1 2022
2 comments
707 views