extract datetime postgres code example
Example 1: get year from date postgres
SELECT EXTRACT(YEAR FROM column_date);
Example 2: postgresql today - 1 year
select now() - INTERVAL '1 YEAR';
SELECT EXTRACT(YEAR FROM column_date);
select now() - INTERVAL '1 YEAR';