You can do something like this:
test=> select NOW() - '1 month'::interval;
?column?
-------------------------------
2004-10-17 12:31:09.944818+02
Simply replace NOW() with your timestamp column.
Regards,
Aleksander
Matt Arnilo S. Baluyos wrote:
> hello everyone,
>
> is there already a built-in function that returns the previous month from the
> current timestamp? (and includes functionality to turn back one year if
> current month is january)
>
> i don't want to reinvent the wheel but if there's none then i guess i would
> just have to make one from scratch.
>