Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proximity search
Message
From
13/04/2010 03:40:12
 
 
To
13/04/2010 03:35:30
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01459851
Message ID:
01459877
Views:
34
>So they precalculate Xaxis, Yaxis and Zaxis for each location
>
>As to point (2) it's possible if you have a table
>
>FK_city1
>FK_City2
>Distance
>
>
>The query is then simply:
>
>select  * 
>   from DistanceTable 
>    where (FK_Where_I_Am in (FK_city1, FK_city2))
>     and (Distance < = 50.0)
>
>
>
>The result needs to be joined
>- with the city table on FK_City2 if (FK_Where_I_Am == FK_city1), and
>- with  the city table on FK_City1 if (FK_Where_I_Am == FK_city2)
>
>
>Can be done with a union
>
>
>select * 
>   from DistanceTable
>    join CityTable on (pk_City = FK_City2)
>    where ( FK_city1 = FK_Where_I_Am )
>     and (Distance < = 50.0)
>union all
>select * 
>   from DistanceTable
>    join CityTable on (pk_City = FK_City1)
>    where ( FK_city2 = FK_Where_I_Am )
>     and (Distance < = 50.0)
>
>
>
>Of course, you never store the distance from a city to itself
>
>You need to find a way to store the distance between two cities only once

So, basically, if I have 100 cities, I would have a Distance table with 10000 records minus 100 records. Is that correct?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform