title: Table alias not working with join
body: <p>I get error <code>Unknown column 'sch1.laestab' in 'field list'</code> on this query </p>
  
  <pre><code>SELECT
      sch1.laestab AS eef_sch_id,
      sch1.sch_name AS sch_name,
      sch1.urn AS sch_dfe,
      foo1.*
  FROM tbl_Schools as sch1
  JOIN (
      SELECT
      sch2.laestab AS eef_sch2_id,
      sch2.sch_name AS sch2_name,
      sch2.urn AS sch2_dfe
      FROM tbl_SimilarSchools ss2
      JOIN tbl_Schools sch2 ON sch2.laestab = ss2.cluster_id
      WHERE cluster_id = sch1.laestab
      AND cluster_id != school_id
      AND sch2.use_KS4 = '1'
      ORDER BY distance2 ASC
      LIMIT 1
  ) as foo1
  </code></pre>
  
  <p>But works fine if I remove <code>JOIN</code> part. What is wrong with my syntaxis?</p>