title: Group by one column from joined table 1 but show based on the latest records from table 2 in descending order
body: <p>I have two tables</p>
  <p><strong>subscribers</strong></p>
  <pre><code>subscriberid | phone
  --------------------
   1           | (555) 555-5554
   2           | (555) 555-5555
  </code></pre>
  <p><strong>messages</strong></p>
  <pre><code>messageid | message        | subscriberid
  ---------------------------------------
   1        | Hello          | 1
   2        | Hello Again    | 1
   3        | Hey            | 2
   4        | Hey Again      | 2
  </code></pre>
  <p>I would like to GROUP BY the Phone in the subscribers table but show the latest message from the second table for that subscriberid.</p>
  <p>My query so far is this, but it's only giving me the earliest message not the latest.</p>
  <pre><code>SELECT s.phone, MAX(m.messageid), m.message 
  FROM subscribers s 
  INNER JOIN messages m ON m.subscriberid = s.subscriberid 
  GROUP BY s.phone 
  ORDER BY m.messageid DESC
  </code></pre>
  <p>How can I get this query to return these results</p>
  <pre><code>messageid         | message  
  ---------------------------------------
   (555) 555-5554   | Hello Again
   (555) 555-5555   | Hey Again 
  </code></pre>