title: SQL Select From Master - Detail Tables
body: <p>I have two tables, named t_master and t_detail.</p>
  
  <p>The data in the t_detail table corresponds to a record on the master table.</p>
  
  <p>Data of t_master</p>
  
  <pre><code>ID Brand
  1  Toyota
  2  Honda
  </code></pre>
  
  <p>Data for the t_detail</p>
  
  <pre><code>DetID ParentID Model
  1     1        Corolla 2009
  2     1        Corolla 2010
  3     1        Corolla 2011
  4     2        Civic 2004
  5     2        Civic 2006
  </code></pre>
  
  <p>Now, I want to make a query that should select all rows in the master table and at the same time, select the detail which has the latest ID (max), i.e.</p>
  
  <pre><code>ID Brand  DetID ParentID Model
  1  Toyota 3     1        Corolla 2011
  2  Honda  5     2        Civic 2006
  </code></pre>
  
  <p>Appreciate your help. Thanks.</p>