title: SQL joins, "there is an entry for table but it cannot be referenced"
body: <p>I have a SQL query which is failing, giving me the error:</p>
  
  <blockquote>
    <p>"There is an entry for table but it cannot be referenced from this part of the query"</p>
  </blockquote>
  
  <p>Going through the query, I need both all 3 tables, but only trips and boats have a matching ID to join on. Test is a shapefile which I need to perform a postGIS function on but it shares no similar column id's to the other two. </p>
  
  <pre><code> select trips.*
   from trips, test
   inner join boats on boats.id = trips.boat_id
   where st_intersects(trips.geom, test.geom) and
   boats.uid = 44
  </code></pre>
  
  <p>I think it has something to do with the join statement but I don't really understand what. I'd be very interested in an explanation of what is happening here.</p>