Answers for "postgresql select month and year from date"

SQL
1

postgres get month name from date

SELECT TO_CHAR(TIMESTAMP '2020-12-16 10:41:35', 'Month') AS "Month";
Posted by: Guest on November-18-2020
0

postgresql get last day of month

SELECT (date_trunc('month', '2017-01-05'::date) + interval '1 month' - interval '1 day')::date
AS end_of_month;
Posted by: Guest on March-05-2021
0

postgresql get last day of month

create function end_of_month(date)
returns date as
$$
select (date_trunc('month', $1) + interval '1 month' - interval '1 day')::date;
$$ language 'sql'
immutable strict;
Posted by: Guest on March-05-2021

Code answers related to "postgresql select month and year from date"

Code answers related to "SQL"

Browse Popular Code Answers by Language