I'm trying to join two tables, one which contains road names and the other just a point. After exhausting research I'm now stuck.
The idea is to join up the two tables using only distance, ie, select all road names which is within 500 meteres of a postcode
My current query does nothing except waste time and I'm wondering where I'm going wrong?
SELECT "R"."name", "P"."Postcode"
FROM "planet_osm_roads" AS "R" JOIN "gb_postcodes" AS "P"
ON st_dwithin(st_transform("P"."Geom", 900913), "R"."way" , 500)
ORDER BY "P"."Geom" <-> st_setsrid(st_makepoint(0.06703376770019531, 51.51646108300825), 900913)
LIMIT 10;
