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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Sorting by a specific column, but not include that on Grouping

Chandu VenuNov 4 2022

Hello,
Create TABLE T1_TEMP(RO_TYPE VARCHAR2(30), Jurisdiction Varchar2(10), Reopening_Order NUMBER, RO_Pending NUMBER, RO_Waiting NUMBER, RO_Granted NUMBER);
Insert into T1_TEMP VALUES ('Provider Requested','J5',1,0,0,1);
Insert into T1_TEMP VALUES ('Appeal','J5',2,1,0,1);
Insert into T1_TEMP VALUES ('Contractor Initiated','J5',3,1,2,3);
Insert into T1_TEMP VALUES ('Home Initiated','J5',8,1,2,3);
Insert into T1_TEMP VALUES ('Govt Request','J5',11,1,2,3);
Insert into T1_TEMP VALUES ('State Initiated','J5',4,1,2,3);
When I query against the above table, I have:
image.pngI am trying to get the numbers summed by each column, grouped by only Juridisction and sort the data based on Reopening_Order. The expected result is shown below:
image.pngThe grouping must not have Reopening_Order. I tried a few methods, but didn't get the expected result.
Any help is greatly appreciated. Thank you!!

This post has been answered by mathguy on Nov 5 2022
Jump to Answer

Comments

Post Details

Added on Nov 4 2022
3 comments
136 views