title: Need help to get dates between two date ranges for multiple records in oracle
body: <p>Hi Can you please help me with this query</p>
  
  <p>I have a table like this</p>
  
  <pre>
       From_date    to_date       price Product
       13-Apr-2012  15-Apr-2012   15    hammer
       1-may-2012   7-May-2012    15    Scredriver 
      </pre>     
  
  <p>From this table , I should derive a new field calc_date - which should contain the dates between from_date and to_date for every row with price and product data being replicated </p>
  
  <p>Result Set :</p>
  
  <pre><code>   From_date    to_date       calc_date     price     Product
       13-Apr-2012  15-Apr-2012  13-Apr-2012   15          hammer
       13-Apr-2012  15-Apr-2012  14-Apr-2012   15          hammer
       13-Apr-2012  15-Apr-2012  15-Apr-2012   15          hammer
       1-may-2012   5-May-2012    1-may-2012   15        Scredriver 
       1-may-2012   5-May-2012    2-may-2012   15        Scredriver 
       1-may-2012   5-May-2012    3-may-2012   15        Scredriver
       1-may-2012   5-May-2012    4-may-2012   15        Scredriver
       1-may-2012   5-May-2012    5-may-2012   15        Scredriver   
  </code></pre>
  
  <p>Sql's that I have tried doesn't fetch me the needed data (Result Set)</p>
  
  <pre><code>      SELECT from_date,
             TO_DATE,
             from_date + (LEVEL - 1) AS calc_date,
             price,
             product
        FROM (SELECT from_date,
                     TO_DATE,
                     price,
                     product
                FROM details)
  CONNECT BY LEVEL &lt;= TO_DATE - (from_date - 1)
  </code></pre>
  
  <p>Can you please help me with query which gives the desired result set mentioned above </p>