[postgis-users] ORDER BY id and distance

Nicklas Avén nicklas.aven at jordogskog.no
Thu Jan 20 00:55:15 PST 2011


SELECT * from myTable order by mapid, ST_Distance(the_geom,
'POINT(Xcoord, Ycood)'::geometry);

HTH
Nicklas



On Thu, 2011-01-20 at 08:38 +0000, Malm Paul wrote:
> Hi,
> I wonder how I can order a result depending on two arguments.
> First:mapid (objects are connected to a mapid) and
> second:within the mapid-sorted objects they should be sorted on the
> distance to a certain coordinate.
>  
> Thanks,
> Paul
> _______________________________________________
> 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