title: Group by months range between year in oracle
body: <p>Friends...I have here a sample data.</p>
  
  <pre><code>+-----------+-------+---------------+
  | PRD       | AMT   |   Date        |
  +-----------+-------+---------------+
  |    1      | 100   |  14-JUL-03    |
  |    1      | 100   |  16-JUN-04    |
  |    1      | 200   |  18-JUL-04    |
  |    1      | 200   |  14-MAY-05    |
  |    2      | 100   |  20-JUL-05    |
  |    2      | 100   |  14-OCT-05    |
  |    2      | 100   |  26-APR-06    |
  +-----------+-------+---------------+
  </code></pre>
  
  <p>I need to sum the amount field by grouping PRD &amp; date between the range (01-JUL-year &amp; 30-June-year+1). 
  Example: For 2003-2004 year, need to compare the range between 01-July-2003 to 30-June-2004. Desired output should be like below:</p>
  
  <pre><code>PRD  |   Sum(AMT) |        year
   1   |    200     |      2003-2004
   1   |    400     |      2004-2005
   2   |    300     |      2005-2006
  </code></pre>
  
  <p>Any help in providing the query/logic would be much gladly appreciated. Thank you so much!</p>