title: How can I limit my sql select to return only one row for max(date), and not multiple rows?
body: <p>I'm trying to select only one id, which has the latest date column, but this sql query returns multiple rows. How can I select only the latest? MAX() doesn't seem to work</p>
  
  <pre><code>select ra.sourceid as partner1, max(ra.date) from ra_table ra join rap_table rap on parentid=ra.sourceid
  where (ra.type = 'Normal' and (ra.name IS NOT NULL or ra.parent IS NOT NULL) and rap.createdate &gt; ra.createdate)
  group by ra.sourceid
  ;
  </code></pre>