[postgis-devel] Non-Join Join

Martin Davis mbdavis at refractions.net
Fri Jul 18 14:23:04 PDT 2008


Good suggestion - that's another way. 

I wonder which is faster (or if there's any difference)?

BTW, wouldn't this be better posted to postgis-users?

Obe, Regina wrote:
> How about
>
> SELECT A.gid, A.geom, A.letter
> FROM (SELECT * FROM lettertable WHERE letter = 'A') A 
> LEFT JOIN (SELECT * FROM lettertable WHERE letter = 'B') B 
> 	ON ST_DWithin(A.the_geom, B.the_geom, 1000)
> WHERE B.gid IS NULL;
>
> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net
> [mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Paul
> Ramsey
> Sent: Friday, July 18, 2008 5:06 PM
> To: PostGIS Development Discussion
> Subject: [postgis-devel] Non-Join Join
>
> Brain freeze:
>
> Give a table
>
> gid integer
> geom geometry
> letter varchar
>
> where letter is a single letter,
>
> how to efficiently find all the instances of the letter 'A' that are
> more than 1000m from any letter 'B'.
>
> P.
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
> -----------------------------------------
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended
> solely for the addressee. If you received this in error, please
> contact the sender and delete the material from any computer.
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022




More information about the postgis-devel mailing list