I want to fill the calendar object which requires start and end date information. I have one column which contains a sequence of dates. Some of the dates are consecutive (ha
SELECT InfoDate ,
CASE
WHEN TRUNC(InfoDate - 1) = TRUNC(lag(InfoDate,1,InfoDate) over (order by InfoDate))
THEN NULL
ELSE InfoDate
END STARTDATE,
CASE
WHEN TRUNC(InfoDate + 1) = TRUNC(lead(InfoDate,1,InfoDate) over (order by InfoDate))
THEN NULL
ELSE InfoDate
END ENDDATE
FROM TABLE;