title: getting duplicate rows
body: <p>If I run the below query I am getting duplicate rows. Could anyone please help .</p>
  <p>using distinct making query running long. never ending</p>
  <pre><code>adate -&gt; 5-may-2022 rdate -&gt; 28th -may-2022
  </code></pre>
  <p>query output getting as</p>
  <pre><code>7-may-2022
  14-may-2022
  21-may-2022
  21-may-2022
  21-may-2022
  </code></pre>
  <p>code is as below</p>
  <pre><code>select * from (
      with qry as (
          SELECT /* + parallel(12) */  adate     AS DATE1,
                       MIN(rdate)    AS DATE2,
             a.id
                  FROM
                      t1                      a,
                      t2          b,
                      t3  c
                  WHERE 
                          a.id = b.id
                  GROUP BY
                      a.id,adate
      )select * from (
        select   id,
        date1 + level - 1 as CurDate,date1,date2
          from qry
        connect by level &lt;= (date2 - date1) + 1)
        --group by id,date1 + level - 1,date1,date2 having count(date1 + level - 1)&gt;1)
      where to_char(curdate,'DY','NLS_DATE_LANGUAGE=ENGLISH') IN('SAT')
      and  (CurDate) NOT IN(date1,date2)) dual;
  </code></pre>