title: relation "table name" does not exist but it was set in FROM
body: <p>I'm trying to use a sub-query in the "FROM" section but later get errors "Relation "Table name" does not exist".</p>
  
  <p>I have tried to copy paste my sub-query which works, but creates really long and ugly code, as what I am sending is just a part of the whole thing which represents the same problem.</p>
  
  <pre><code>SELECT Reporter.rid , Reporter.fname , Reporter.lname
  FROM Reporter , report , map , keyword , (  SELECT  Reporter.rid                                                             
                                           FROM Reporter , report , map , 
                                                keyword
  
                                          WHERE (Reporter.rid = report.rid  
                                                 AND report.iid = map.iid 
  
                                                  AND map.kword = 
                                                  keyword.kword AND 
                                                  keyword.subject &lt;&gt; 
                                                 'health')     
                                        ) AS nonH
  
  WHERE (Reporter.rid NOT IN(SELECT * FROM nonH) AND Reporter.rid = report.rid)
  </code></pre>
  
  <p>I would expect this code to work and present me all Reporters who are not linked to anything but 'health'</p>
  
  <p>Error msg is: </p>
  
  <blockquote>
    <p>ERROR:  relation "nonh" does not exist LINE 7: WHERE (Reporter.rid NOT
    IN(SELECT * FROM nonH) AND Reporter....</p>
  </blockquote>