title: LIMIT 1 inside JOIN from specific tables in MySQL?
body: <p>I want to show the user last activity. (you can read my <a href="https://stackoverflow.com/questions/4114784/">last question</a> for more info about it)</p>
  
  <p>I need to do a big JOIN (6+ tables).</p>
  
  <p>I need to get only one row per ID but there are some tables that contain more than one row per ID. For example an article ID can have only one row in the 'votes' table but it can have a lot in the 'images' table because there can be more than one image per article, but I want just one image.</p>
  
  <p>So I need to do something like this (of course this code is wrong):</p>
  
  <pre><code>SELECT table1.item, table2.item, table3.item, table4.item, table5.item 
  FROM table1
  LEFT OUTER JOIN ... ON ... AND ...
  LEFT OUTER JOIN ... ON ... AND ...
  LEFT OUTER JOIN ... ON ... AND ... LIMIT 1
  LEFT OUTER JOIN ... ON ... AND ... LIMIT 1
  WHERE table1.item = ?;
  </code></pre>
  
  <p>How can I accomplish that?</p>