title: Getting the latest row from status
body: <p>Supposed I have a table with the following rows</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">test_no</th>
  <th style="text-align: center;">test_count_no</th>
  <th style="text-align: center;">test_status</th>
  <th style="text-align: center;">test_run_no</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">1</td>
  <td style="text-align: center;">0</td>
  <td style="text-align: center;">STOP</td>
  <td style="text-align: center;">1</td>
  </tr>
  <tr>
  <td style="text-align: center;">2</td>
  <td style="text-align: center;">66</td>
  <td style="text-align: center;">FINISH</td>
  <td style="text-align: center;">1</td>
  </tr>
  <tr>
  <td style="text-align: center;">3</td>
  <td style="text-align: center;">67</td>
  <td style="text-align: center;">FINISH</td>
  <td style="text-align: center;">1</td>
  </tr>
  <tr>
  <td style="text-align: center;">4</td>
  <td style="text-align: center;">0</td>
  <td style="text-align: center;">STOP</td>
  <td style="text-align: center;">2</td>
  </tr>
  <tr>
  <td style="text-align: center;">5</td>
  <td style="text-align: center;">0</td>
  <td style="text-align: center;">STOP</td>
  <td style="text-align: center;">2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I need to get the row which has a <code>test_status</code> of <code>FINISH</code> and has the latest <code>test_no</code>,</p>
  <p>for example <code>test_run_no=1</code> since there is <code>two test_status</code> of <code>FINISH</code>, I only need to get the latest <code>test_no</code> which is <strong>3</strong></p>
  <p>In case of <code>test_run_no=2</code> since there is no <code>test_status=FINISH</code> i only need to return the first row.</p>
  <p>The result will be:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">test_no</th>
  <th style="text-align: center;">test_count_no</th>
  <th style="text-align: center;">test_status</th>
  <th style="text-align: center;">test_run_no</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">3</td>
  <td style="text-align: center;">67</td>
  <td style="text-align: center;">FINISH</td>
  <td style="text-align: center;">1</td>
  </tr>
  <tr>
  <td style="text-align: center;">4</td>
  <td style="text-align: center;">0</td>
  <td style="text-align: center;">STOP</td>
  <td style="text-align: center;">2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>My current query is</p>
  <pre><code>SELECT MAX(test_table.test_run_no)
  FROM test_table
  WHERE test_table.run_status = 'FINISH'
  GROUP BY test_table.test_no
  </code></pre>
  <p>Any idea on what query should I add in order to achieve the result ?</p>