title: Calendar Last day of Month Oracle
body: <p>I need to create a calendar in Oracle with only last days of month between two dates.</p>
  <p>I tried to do with this but it creates a calendar with all days between two dates and I only need the last dayS of the month.</p>
  <pre><code>begin
    begin_date := TO_NUMBER(TO_CHAR(TO_DATE('2021-01-01', 'yyyy-MM-dd'), 'j'));
    end_date := TO_NUMBER(TO_CHAR(ADD_MONTHS(LAST_DAY(TO_DATE(sysdate, 'yyyy-MM-dd')),-1), 'j'));
    WITH calendar AS (
     SELECT to_date(begin_date, 'mm/dd/yyyy') + ROWNUM - 1 c_date
       FROM dual
      CONNECT BY LEVEL &lt;= to_date(end_date, 'mm/dd/yyyy') 
                          - to_date(begin_date, 'mm/dd/yyyy') + 1
  )
  SELECT c_date &quot;date&quot;, ID 
    FROM (SELECT c.c_date, EXPE.ID AS ID
             FROM EXPEDIENTE EXPE, calendar c
             WHERE EXPE.ID=1)
  ORDER BY 1,2;
  </code></pre>
  <p>How can i do that?</p>