title: LEFT JOIN with 3 tables
body: <p>I am having trouble joining 3 tables together. I have a <code>SELECT</code> that works for two of the tables, which is the main data i'd like to see. I would also like to add the rate and tax to the units that are selected. They are stored in a different table because units can have more than one rate in my situation. Here is the query that works:</p>
  
  <pre><code>SELECT u.unit_name from units u 
  LEFT JOIN reservations r ON r.unit = u.id
      AND r.arrival &lt;= 2013-10-11
      AND r.departure &gt;= 2013-10-01
  WHERE r.unit IS NULL
  </code></pre>
  
  <p>And the one I am trying to make that doesn't:</p>
  
  <pre><code>SELECT u.unit_name, ur.unit, ur.rate, ur.tax
  FROM units u
  LEFT JOIN reservations r 
  INNER JOIN unit_rates ur 
      ON r.unit = u.id
      ON ur.unit = u.id
      AND r.arrival &lt;= 2013-10-11
      AND r.departure &gt;= 2013-10-01
  WHERE r.unit IS NULL 
      AND ur.active = TRUE
  </code></pre>
  
  <p>HERE is the SQLfiddle: <a href="http://sqlfiddle.com/#!2/b303ad" rel="nofollow">http://sqlfiddle.com/#!2/b303ad</a></p>