title: MySQL join two table with the maximum value on another field
body: <p>I have two table account and balance</p>
  
  <pre><code>/---------------------\
  | cid | name | mobile |
  |---------------------|
  |  1  | ABC  | 12345  |
  |---------------------|
  |  2  | XYZ  | 98475  |
  \---------------------/
  
  /----------------------------\
  | date       | cid | balance |
  |----------------------------|
  | 2013-09-19 |  1  |   5000  |
  |----------------------------|
  | 2013-09-19 |  2  |   7000  |
  |----------------------------|
  | 2013-09-20 |  1  |    300  |
  |----------------------------|
  | 2013-09-20 |  2  |   4500  |
  |----------------------------|
  | 2013-09-21 |  2  |    600  |
  \----------------------------/
  </code></pre>
  
  <p>I would like to join this two table and get the balance of the maximum date for a particular cid.</p>
  
  <p>Output result as -</p>
  
  <pre><code>/--------------------------------------------\
  | cid | name | mobile | date       | balance |
  |--------------------------------------------|
  |  1  | ABC  | 12345  | 2013-09-20 |   300   |
  |--------------------------------------------|
  |  2  | XYZ  | 98475  | 2013-09-21 |   600   |
  \--------------------------------------------/
  </code></pre>