I am looking for a way to replace EOMONTH in PostgreSQL. I have a db with a date column. I have a script I want to run on the first of the month that will select only the rows that fall between last months first day and last day.
I need the equivalent of this:
SELECT *
FROM database
WHERE dateCol BETWEEN SYMMETRIC EOMONTH(GETDATE(),-2)+1 AND EOMONTH(GETDATE(),-1);
I am very new to SQL, so let me know if something doesn't make sense. Thank you!