How to get current date, day, month, year in Redshift database

Run the below command to get current month from current date in Redshift database.

For current date:

select CURRENT_DATE;

For current day:

select EXTRACT(DAY FROM CURRENT_DATE) AS day;

For current month:

select EXTRACT(MONTH FROM CURRENT_DATE) AS month;

For current year:

select EXTRACT(YEAR FROM CURRENT_DATE) AS year;
See also  Coalesce function in Redshift database