<div dir="ltr"><div><br></div><div>You don't need to create additional columns to check exising ones in WHERE-clause, so your query is simlply:</div><div><br></div>SELECT * FROM public.lines WHERE ST_IsClosed(lines.linestring);<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-14 23:21 GMT+03:00 Christopher Braune <span dir="ltr"><<a href="mailto:chbraune@uni-potsdam.de" target="_blank">chbraune@uni-potsdam.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello PostGIS-Users,<br>
<br>
I want to select all closed lines in my dataset. I think the function ST_IsClosed is usefull for this task.<br>
<br>
I tried the following SQL-Sentence:<br>
>><br>
SELECT *, (SELECT ST_IsClosed(lines.linestring) AS tof) FROM public.lines WHERE tof='TRUE';<br>
<<<br>
<br>
I get this error-message:<br>
<br>
>><br>
ERROR: column "tof" does not exist<br>
LINE 3: ...s.linestring) AS tof) FROM public.lines WHERE tof='TRUE'...<br>
^<br>
********** Fehler **********<br>
<br>
ERROR: column "tof" does not exist<br>
SQL Status:42703<br>
Zeichen:131<br>
<<<br>
<br>
Can anybody help me? In general I want to know how I use the boolean-results (like ST_IsClosed) in nested queries.<br>
<br>
Best regards,<br>
Christopher<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Darafei "Komяpa" Praliaskouski<br>OSM BY Team - <a href="http://openstreetmap.by/" target="_blank">http://openstreetmap.by/</a><br><a href="mailto:xmpp%3Ame@komzpa.net" target="_blank">xmpp:me@komzpa.net</a> mailto:<a href="mailto:me@komzpa.net" target="_blank">me@komzpa.net</a><br>
</div>