How to get the last day of month in postgres?

前端 未结 5 1443
醉话见心
醉话见心 2020-12-18 17:47

How to find the last day os the month in postgres? I have a date columns stored as numeric(18) in the format(YYYYMMDD) I am trying it to make it date using

         


        
5条回答
  •  轮回少年
    2020-12-18 18:35

    select to_char(date_trunc('month', now() + '01 Months'::interval) - '01 Days'::interval, 'YYYYmmDD'::text)::numeric as end_period_n

提交回复
热议问题