I am trying to generate some data to populate a timestamp. My goal is to have 15 minute intervals between each row and populate the digits after the decimal so the fractional part isn't always .000000
Below is my attempt. Any SQL or mathematical help would be greatly appreciated.
Thanks in advance to all who answer.
CREATE TABLE t3 (
seq_num NUMBER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
dt TIMESTAMP)
PARTITION BY RANGE (dt)
INTERVAL ( NUMTODSINTERVAL (1, 'DAY') ) (
PARTITION OLD_DATA VALUES LESS THAN (TIMESTAMP '2022-01-01 00:00:00.000000')
);
/
INSERT into t3 (dt)
with dt (dt, interv) as (
select date '2022-01-01', numtodsinterval(15,'MINUTE') + numtodsinterval((1+rownum/(24*60*60*2)),'SECOND')from dual
union all
select dt.dt + interv, interv from dt
where dt.dt + interv < date '2022-01-15')
select dt from dt;
/