<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi, I have the following query:<br><br>SELECT gid, name, track_use, st_astext(clipped_geom)<br>FROM (SELECT source.track_cl.gid, source.track_cl.name, source.track_cl.track_use,(ST_Dump(ST_Intersection(extents.tiles.the_geom, source.track_cl.the_geom))).geom As clipped_geom<br>FROM source.track_cl<br>INNER JOIN extents.tiles<br>ON ST_Intersects(extents.tiles.the_geom, source.track_cl.the_geom) where extents.tiles.name='BP33' ) As clipped <br>WHERE st_geometrytype(clipped.clipped_geom) = st_geometrytype(source.track_cl.the_geom);<br><br> which gives me:<br><br>ERROR: missing FROM-clause entry for table "track_cl"<br>LINE 6: ...metrytype(clipped.clipped_geom) = st_geometrytype(source.tra...<br>SQL state: 42P01<br>Character: 471<br><br><br>On the other hand this version of the same query works (only the last line differs):<br>
<br>SELECT gid, name, track_use, st_astext(clipped_geom)<br>FROM (SELECT source.track_cl.gid, source.track_cl.name, source.track_cl.track_use,(ST_Dump(ST_Intersection(extents.tiles.the_geom, source.track_cl.the_geom))).geom As clipped_geom<br>FROM source.track_cl<br>INNER JOIN extents.tiles<br>ON ST_Intersects(extents.tiles.the_geom, source.track_cl.the_geom) where tiles.name='BP33' ) As clipped<br>WHERE ST_Dimension(clipped.clipped_geom) >0;<br><br>I cannot figure out what is wrong with the first query.<br>Many thanks.<br>George<br> </body>
</html>