1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| CREATE OR REPLACE FORCE VIEW "S02"."NEXT" ("OTP", "LAST", "Next1", "Next2", "Next3", "Next4", "Next5", "Next6", "Next7", "Next8", "Next9", "Next10", "Next11", "Next12")
AS
SELECT ct.cd_pwo ,
ct.DT_REAL_LAST_END,
add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday)Next1,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*2) Next2,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*3) Next3,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*4)Next4,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*5) Next5,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*6)Next6,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*7)Next7,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*8)Next8,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*9)Next9,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*10)Next10,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*11)Next11,
Add_Months(TO_CHAR(Dt_Next_Bgn,'DD/MM/YYYY'),Val_Nextday*12) Next12
FROM Cm_Trigger Ct , Pws
WHERE Pws.Cd_Pwo <> 1
AND Pws.Cd_Pwo =Ct.Cd_Pwo
AND Ct.Bo_Active='1'
ORDER BY 1 ASC; |
Partager