Con ANSI SQL:
WITH
n AS ( /* numeracion del 0 al 9 */
select 0 as i union all
select 1 union all
select 2 union all
select 3 union all
select 4 union all
select 5 union all
select 6 union all
select 7 union all
select 8 union all
select 9
)
,numbers AS ( /* multiplicacion carteciana de n numeros */
SELECT
a.i -- n = 10
* 10 + b.i -- n x 10n = 100
* 100 + c.i -- n x 10n x 100n = 1000
AS i
FROM n AS a
CROSS JOIN n AS b
CROSS JOIN n AS c
)
,fechas AS ( /* numeros a fecha con un valor inicial */
SELECT
DATE('0001-01-01') + i AS fecha
FROM numbers
)
SELECT * FROM fechas
ORDER BY fecha
Con Vertica
WITH
inicio AS (
SELECT '2019-01-15'::TIMESTAMP as tm
UNION ALL
SELECT '2021-12-15'::TIMESTAMP
)
,fechas AS (
SELECT
date(ts) AS fecha
FROM inicio
TIMESERIES ts AS '1 day' OVER( ORDER BY tm )
)
SELECT * FROM fechas