title: How to select data with condition
body: <p>I am trying to retrieve all row of data within some date range with only 1 condition which is only retrieve first row of type 'balance' , i think my question should explain better with data sample. </p>
  
  <p><strong>Here is my table <em>statement</em></strong></p>
  
  <pre><code>| date | type     | credit | debit | balance |
  |   a  | balance  |        |       |  100.00 |
  |   a  | credit   | 50.00  |       |         |
  |   a  | credit   | 50.00  |       |         |
  |   a  | debit    |        | 50.00 |         |
  |   b  | balance  |        |       |  50.00  |
  |   b  | credit   | 50.00  |       |         |
  |   b  | credit   | 50.00  |       |         |
  |   b  | credit   | 50.00  |       |         |
  |   b  | balance  |        |       | -100.00 |
  |   c  | debit    |        | 250.00|         |
  </code></pre>
  
  <p><strong>This is what i trying to do (expected result)</strong></p>
  
  <p>I need to perform a query which return all row from date a to c but only first row with type balance</p>
  
  <pre><code>| date | type     | credit | debit | balance |
  |   a  | balance  |        |       |  100.00 |
  |   a  | credit   | 50.00  |       |         |
  |   a  | credit   | 50.00  |       |         |
  |   a  | debit    |        | 50.00 |         |
  |   b  | credit   | 50.00  |       |         |
  |   b  | credit   | 50.00  |       |         |
  |   b  | credit   | 50.00  |       |         |
  |   c  | debit    |        | 250.00|         |
  </code></pre>
  
  <p>What i know here is i can achieve by doing 2 different query </p>
  
  <pre><code>SELECT * FROM statement WHERE date &gt;= a and date &lt;= c and type = 'balance' ORDER BY date ASC LIMIT 1
  SELECT * FROM statement WHERE date &gt;= a and date &lt;= c and type != 'balance' ORDER BY date ASC
  </code></pre>
  
  <p>Here is my question , For some reason i need to done this with 1 single query , How do i achieve this result by one query.</p>