select trunc(last_day(sysdate)) - to_date(to_char(sysdate, 'yyyy-mm') || '-01', 'yyyy-mm-dd') + 1 from dual