Please tell how I can create a loop function to give the following result as:
select_char (add_months (trunc (sysdate, 'MM'), -0), 'MM') || '-' || To_char (add_months (trunc (sysdate, 'MM'), - 0), 'm y'), - 1), 'mm')) '-' || To_char (ADMM) (Trunk (Susset, 'MM'), - 1), 'YYYY') date_1, to_char (add_months (trunc (sysdate, 'MM'), - 2), 'MM') || '-' || To_char (sum (months) (trunc (sysdate, 'MM'), - 2), 'YYYY' date 2, to_char (ADMM) (trunk (SIDDET, 'MM'), - 3), 'MM' || '-' || To_achore (trunk (syndicate, 'mm'), - 3), 'y y y y' dated_3, to'achure (admm) (trunk (cascade, 'mm'), -4), 'mm') || '-' || To_char (add_months (trunc (sysdate, 'MM'),), - 5), 'YYYY') date-4, to_char (Toxic, 'MM'), 'to_char (AdMmths (Trunk (Sisadet, 'MM'), -6), 'MM') || '-' to_char (add_months trunk (sysdate, 'MM'), -6), 'YYYY' date_6, to_char (admM (trunk (Susset, 'MM'), - 7), 'MM'. | '- to_char (add_months) (),' MM ') - (),' MM ') - (),' MM '), (),' MM ', - (7),' YYYY ') date_7 , To_char (admm (trunk (sysdate, 'MM'), - 8) Add_months (trunc (sysdate, 'mm'), - 8), 'yyyy' date_6, to_char (trunk (sysdate, 'MM') , 9), 'MM') || '-' || To_char (ADMM), (), 'MM') - - 9), 'YYYY' date_9, to_char (ADMM (trunk (Sisadet, 'MM'), - 10), 'MM') || '-' || To_char (add_months (trunc (sysdate, 'mm'), - 10), 'yyyy' date_10, to_char (add_months (trunc (sysdate, 'mm'), - 11), 'mm'). '-' | | To_char (add_months (trunc (sysdate, 'MM'), - 11), 'YYYY' from two days to I want to populate in the results column, such as .. .
I would like to know I want to use back to January 2000, but do not really want to repeat these lines, and every month I have to add another line to cover the new month. I am thinking that there is a loop function in any DO in SOCL ... hide in Excel.
thanks
SMORF
I think you What do you want:
from select * (selection level -1 num, to_char (add_months '' - (level-1)), 'mm' - '-' (to_char (admm) According to the level (lt; = 12) axis (maximum (DTE)) in the form of DTE to connect two according to the level (as trunk (SIDDET, 'MM'), - (Level-1)), 'YYYY' As in "DATE" (0 as "content", 1 "1", 2 like "2", 3 as "" 6 ", 7 like" 7 ", 8 like" 8 ", 9 like" 9 ", 10 to" 10 ", 11 as" 11 ", in the form of" 11 " "4"))
Output:
CURRENT_DATE 1_DATE 2_DATE 3_DATE 4_DATE 5_DATE 6_DATE 7_DATE 8_DATE 9_DATE 10_DATE 11_DATE 10-2014 09-2014 08-2014 07-2014 06 -2014 05-2014 04-2014 03-2014 02-2014 01-2014 12-2013 11-2013
Comments
Post a Comment