Skip to content
Advertisement

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

Advertisement

Answer

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;
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement