I have this cast in my Oracle SP, but at the time of grouping it, it tells me that it can not be done for the same topic, but if I can run it out with a simple select, does anyone know if there is any alternate way to do this?
SELECT case when START_TIME > 24*60*60*30 then cast(cast(EXTRACT(YEAR from E.ON_DATE) AS VARCHAR(4)) || substr('00' || CAST(EXTRACT(month from E.ON_DATE) AS VARCHAR(2)),-2,2) || substr('00' || CAST(EXTRACT(day from E.ON_DATE) AS VARCHAR(2)),-2,2) as NUMBER(9)) + 1
else
cast(cast(EXTRACT(YEAR from E.ON_DATE) AS VARCHAR(4)) || substr('00' || CAST(EXTRACT(month from E.ON_DATE) AS VARCHAR(2)),-2,2) || substr('00' || CAST(EXTRACT(day from E.ON_DATE) AS VARCHAR(2)),-2,2) as NUMBER(9)) END TIEMPO_NUEVO
FROM EVENT E