title: SQL limit in many join
body: <p>I have a big query with a lot of inner join inside in a page on my website.
  I want to apply for some left outer join limit 1 but if I put it into the sql give me errors.</p>
  
  <p>This is a small part of my query isn't total, this query is only a part and ISN'T FINISH:</p>
  
  <pre><code>SELECT * FROM products 
                 LEFT OUTER JOIN  (origins 
                          LEFT OUTER JOIN  origin_aliases ON origin_aliases.origin_id = origins.id 
                          AND origin_aliases.language = '$lang'
                          LEFT OUTER JOIN  (diets LEFT OUTER JOIN  diet_aliases ON diet_aliases.diet_id = diets.id AND diet_aliases.language = '$lang') 
                          ON origins.diet_id = diets.id) 
                  ON products.origin_id = origins.id
                  LEFT OUTER JOIN  (product_aliases 
                          LEFT OUTER JOIN  (users as users1
                              LEFT OUTER JOIN  profiles as profiles1 ON profiles1.user_id = users1.id
                              LEFT OUTER JOIN  user_options as user_options1 ON user_options1.user_id = users1.id 
                              LEFT OUTER JOIN  avatars as avatars1 ON avatars1.user_id = users1.id
                          ) 
                          ON  product_aliases.user_id =users1.id
                          LEFT OUTER JOIN  (users as users2
                              LEFT OUTER JOIN  profiles as profiles2 ON profiles2.user_id = users2.id
                              LEFT OUTER JOIN  user_options as user_options2 ON user_options2.user_id = users2.id
                              LEFT OUTER JOIN  avatars as avatars2 ON avatars2.user_id = users2.id 
                          )  
                          ON  product_aliases.edit_user_id = users2.id)
                  ON product_aliases.product_id = products.id  
  </code></pre>
  
  <p>.....</p>
  
  <p>For example I want to apply limit 1 in the left outer join in origins after  <code>ON 'products.origin_id'='origins.id'</code> is possible? How can I do this?
  I have tried to put after the on condition limit 1 but give me an error</p>
  
  <blockquote>
    <p>Syntax error or access violation: 1064 You have an error in your SQL
    syntax; check the manual that corresponds to your MySQL server version
    for the right syntax</p>
  </blockquote>