|  | Posted by matthewf_boi on 11/15/06 04:02 
Pacific Fox wrote:> Hello all,
 > Does anyone know the SQL statement for calculating surrounding suburbs,
 > or can point me in the right direction?
 > I have a database of Australian postal codes and their centroids in
 > longitude and latitude, I'd like to pass it either the long/lat or
 > postal code to calculate from. And preferably return distance as well,
 > in KM..
 >
 > Thanks in advance.
 
 is this Oracle or MSSQL?  Oh well, it probably doesn't matter.
 
 Try this:
 select myzip as varchar(32) from centroids
 join long_lat on zip_code = coordinate
 where distance < .75km
 and postcode in (4101, 4106, 4000, 2580 4169)
 
 I am pretty sure that should take care of it for you.
 Regards
  Navigation: [Reply to this message] |