I am stuck in one request,
where I have data for 52 weeks, which I can organize according to sysdate, getting the week number and comparing with the week number of the data. now what I want to do is if the number of the current week is 10, I want to organize all the weeks in descending order, for example, depending on the date sysdate week10, week9, week8 ......... week11,
with this request
select "Weekly","Quarter","SALES","Monthly",week_number from fiscal_calendar where week_number <= TO_CHAR(TO_DATE(sysdate,'DD-mon-YYYY'),'iw') order by week_number desc;
I can sort the data up to week 1, but I want to continue the sequence, as, for example, on week 11 so I'm doing something wrong please advice
source share