> On Jun 9, 2015, at 2:53 PM, Jean-Christophe Deschamps <jcd at antichoc.net>
> wrote:
>
> Most probably! I can imagine that you don't encounter such style in common
> business-like environments.
Just for ?corporate' fun: analytic recursive common table expression - oh, my?
with
Clock( start_at, end_at, interval, tick )
as
(
select date '2015-01-01' as start_at,
timestamp '2015-01-01 23:59:59' as end_at,
interval '15' minute as interval,
date '2015-01-01' as tick
from dual
union all
select start_at,
end_at,
interval,
tick + interval as tick
from Clock
where tick + interval between start_at and end_at
)
select Clock.tick,
lead( Clock.tick ) over( order by Clock.tick ) as next_tick
from Clock
order by Clock.tick;