For example, the given date is 04/04/1924 and I want to find out the last day of February of the year 1924.
I came up with the add_month but it
This will show you the last day of month
SELECT Max(LAST_DAY(ADD_MONTHS(SYSDATE, -2)) + level)
FROM dual
CONNECT BY
level <= LAST_DAY(ADD_MONTHS(SYSDATE, -1)) - LAST_DAY(ADD_MONTHS(SYSDATE, -2))
you can replace system date what ever date you want with to_date('04/04/1924','MM-DD-YYYY')
SELECT Max(LAST_DAY(ADD_MONTHS(to_date('04/04/1924','MM-DD-YYYY'), -2)) + level)
FROM dual
CONNECT BY
level <= LAST_DAY(ADD_MONTHS(to_date('04/04/1924','MM-DD-YYYY'), -1)) - LAST_DAY(ADD_MONTHS(to_date('04/04/1924','MM-DD-YYYY'), -2))
or simply
select LAST_DAY(ADD_MONTHS(to_date('04/04/1924','MM-DD-YYYY'), -2)) from dual;