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!

Generate total and grand totals

Gor_MahiaOct 2 2021

Hi,
I've a table as below with sample records. there might be some other columns to display beside beside but the below are the major columns

FK CATEGORY AMT
================
1 TX 30
1 NC 45
2 NY 15
2 TX 20
2 NC 33
2 OTHERS 5
3 TX 10
3 NC 10
3 NY 40
3 OTHERS 20
4. NY 50

now i want to create a summary output with total and grand totals as show below

FK CATEGORY AMT
==================================
1 TX 30
NC 45
TOTAL 75
2 NY 15
TX 20
NC 33
OTHERS 5
TOTAL 73
3 TX 10
NC 10
NY 40
OTHERS 20
TOTAL 80
Grand Total 258

thanks in advance.

This post has been answered by Frank Kulash on Oct 2 2021
Jump to Answer
Comments
Post Details
Added on Oct 2 2021
1 comment
1,933 views