[postgis-users] SQL Statement for Multiple Tables - operator doesn't exist: boolean && geometry

Paul Ramsey pramsey at refractions.net
Wed Jan 11 22:50:27 PST 2006


Just add an "and":

SELECT zipcodes.name, urban_areas.name, states.state
FROM zipcodes, urban_areas, states
WHERE distance( zipcodes.the_geom, 'POINT(-88.0501 41.8623)') = 0 AND  
zipcodes.the_geom && urban_areas.the_geom
AND zipcodes.the_geom && states.the_geom

On Jan 11, 2006, at 10:39 PM, Adam wrote:

> I have three tables:  zip codes, metro areas, and states.
>
> My sql statement is:
>
> SELECT zipcodes.name, urban_areas.name, states.state FROM zipcodes,  
> urban_areas, states WHERE distance( zipcodes.the_geom, 'POINT 
> (-88.0501 41.8623)') = 0 AND zipcodes.the_geom &&  
> urban_areas.the_geom && states.the_geom
>
> When I try to query them all in one statement I get this error:
> operator does not exist, boolean && geometry
> Hint:  No operator matches the given name and argument type(s).   
> You may need to add explicit type casts.
>
> If I run this statement with only two tables instead of three this  
> statement will work.
>
> How should I join three plus tables and query for one locaton?
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list