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!

Sort Months by Cal Year/Fiscal Year/Alphabetically

Veerendra PatilMay 16 2022

Hi,
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
We have a front-end simple chart which shows months Vs value data -
With fiscal_year as (select &fis_year_start_month from dual)
,data as(
Select 'January' month, 1000 val from dual union all
Select 'February' month, 2000 val from dual union all
Select 'March' month, 3000 val from dual union all
Select 'April' month, 4000 val from dual union all
Select 'May' month, 5000 val from dual union all
Select 'June' month, 6000 val from dual union all
Select 'July' month, 7000 val from dual union all
Select 'August' month, 8000 val from dual union all
Select 'September' month, 9000 val from dual union all
Select 'October' month, 10000 val from dual union all
Select 'November' month, 11000 val from dual union all
Select 'December' month, 12000 val from dual
)select * from data
--- ORDER BY CASE param (A, C, F);
The chart has 3 options to sort by - Alphabetically (A), Calendar months(C)(Jan-Dec), Fiscal Year (F) (This is a param based on clients)
How to achieve this please?
Thanks.

This post has been answered by Solomon Yakobson on May 16 2022
Jump to Answer
Comments
Post Details
Added on May 16 2022
17 comments
432 views