title: mySQL: Issue with Left Join
body: <p>I have the following query:</p>
  
  <pre><code> SELECT c.`entity_id`,c. p.`name` as parent_id, c.`name`
    FROM category c
    LEFT JOIN category p WHERE c.`parent_id = p.id
    WHERE c.is_active = 1
    ORDER BY c.parent_id ASC, c.position ASC;
  </code></pre>
  
  <p>But I get an error on the first WHERE clause, can anyone spot the error here? Thanks</p>