You are here: Re: SQL to calculate surrounding suburbs « MsSQL Server « IT news, forums, messages
Re: SQL to calculate surrounding suburbs

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация