Search code examples
sqlnetezzasys

SYS_CALENDAR function in SQL Netezza


please

how can I run a query that generate a calendar in SQL Netezza like the below query that works with Teradata

SELECT *
   FROM SYS_CALENDAR.Calendar
   where calendar_date BETWEEN '2021-01-01' and current_date

Solution

  • select ('2021-01-01'::date + (interval '1 day' * idx))::date  as the_date
    from _v_vector_idx where the_date between '2021-01-01' and current_date;