How to get last day of a month from a given date?

前端 未结 7 1354
长情又很酷
长情又很酷 2021-02-12 14:18

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

7条回答
  •  独厮守ぢ
    2021-02-12 15:07

    if you want know if your date is final mount

    SELECT
    case when
    TO_DATE('19240430','YYYYMMDD') = LAST_DAY(TO_DATE('04/04/1924','MM/DD/YYYY'))
    THEN 1 ELSE 0 END LAST_MOUNTH_DAY FROM DUAL
    

提交回复
热议问题