title: i want to find two value from selected month and year using SQL select query
body: <p><a href="http://i.stack.imgur.com/if28I.png" rel="nofollow">Click here For Output</a>  </p>
  
  <p>Here is my select query:</p>
  
  <pre><code>/* First query */
  SELECT YEAR, SUM( amount ) AS total
  FROM accounts
  WHERE ((MONTH &gt;=  '10' || 
          MONTH &lt;=  '12' &amp;&amp; YEAR =  '2015') &amp;&amp; 
         (MONTH &gt;=  '1' || 
          MONTH &lt;=  '3' &amp;&amp; YEAR =  '2016'))
  GROUP BY YEAR
  
  /* Second query */
  SELECT YEAR, SUM( amount ) AS total
  FROM accounts
  WHERE ((MONTH &gt;=  '1' || 
          MONTH &lt;=  '3' &amp;&amp; YEAR =  '2015') &amp;&amp;
         (MONTH &gt;=  '5' || 
          MONTH &lt;=  '10' &amp;&amp; YEAR =  '2015'))
  GROUP BY YEAR
  </code></pre>
  
  <p>The first query will return the total amount over two rows which is exactly what I want, but if the user selects month in second query, then it will only return one row but I need two rows based on the where condition.</p>
  
  <p>Please help me. </p>