I am trying to get the following in Postgres:
select day_in_month(2);
Expected output:
28
Is there any bu
This works as well.
WITH date_ AS (SELECT your_date AS d) SELECT d + INTERVAL '1 month' - d FROM date_;
Or just:
SELECT your_date + INTERVAL '1 month' - your_date;
These two return interval, not integer.