This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
publik-bi/create_dates.sql

10 lines
373 B
SQL

-- Crée une table de dates entre 2010 et 2020
DROP TABLE IF EXISTS dates;
CREATE TABLE dates AS (SELECT
the_date.the_date::date AS date,
to_char(the_date.the_date, 'TMday') AS day,
to_char(the_date.the_date, 'TMmonth') AS month
FROM
generate_series('2010-01-01'::date, '2020-01-01'::date, '1 day'::interval)
AS the_date(the_date));