title: MySQL join inside subquery
body: <p>I have this:</p>
  
  <pre><code># tab1 = Company
  # tab2 = Forms
  # tab3 = Filled forms from each company enabled to it.
  
  # Search Companies with pending/empty Forms.
  # Company #1 has 3 forms, all filled, not will be listed;
  # Company #2 has form 2 and 3, only form 2 is filled, so it will be listed;
  # Company #3 has not form filled, so it will be listed;
  
  SELECT company.*
  FROM tab1 as company
  
  WHERE (
    SELECT TRUE
    FROM tab2 AS forms
  
    # Join compatible company forms results/fills.
    # Itll join with company.id (that here not exists) and the forms.id (that exists)
    LEFT JOIN tab3 AS fills ON
      fills.id_tab1 = company.id AND
      fills.id_tab2 = forms.id
  
    # Itll filter forms that company have.
    # And will accept ONLY if none result is found, what mean "pending fill" on company.
    # I need just that.
    WHERE 
      FIND_IN_SET(forms.id, company.id_forms) AND
      fills.id IS NULL
  )
  </code></pre>
  
  <p>And I get <strong>Unknown column <code>tab1.id</code></strong>.<br />How to solve it?</p>
  
  <p>I need have access to <code>tab1</code> columns inside of INNER of SUBQUERY.</p>
  
  <p><strong>Update #1</strong> -
  <strong>Live sample</strong>: <a href="http://sqlfiddle.com/#!2/20aa5/3" rel="nofollow">http://sqlfiddle.com/#!2/20aa5/3</a></p>