postgress date code example
Example 1: postgresql today - 1 year
select now() - INTERVAL '1 YEAR';
Example 2: postgre query date
SELECT * FROM data WHERE date = '2020-12-21'
select now() - INTERVAL '1 YEAR';
SELECT * FROM data WHERE date = '2020-12-21'