use ngcp;

drop table if exists date_range_helper;
create table date_range_helper (d date, index (d));
insert into date_range_helper select adddate('1970-01-01',d4.i*10000 + d3.i*1000 + d2.i*100 + d1.i*10 + d0.i) from
(select 0 as i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) d0,
(select 0 as i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) d1,
(select 0 as i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) d2,
(select 0 as i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) d3,
(select 0 as i union select 1 union select 2) d4;
