問題描述:
table1
name? ?? ?? latitude? ?? ?? ?longitude
2112 W Peterson Ave? ?? ?? ?41.991178? ?? ???-87.683593
63rd St Beach? ?? ?? ?41.781016? ?? ???-87.57612
900 W Harrison St? ?? ??? 41.874675? ?? ???-87.650019
Aberdeen St & Jackson Blvd? ?? ??? 41.877726? ?? ???-87.654787
Aberdeen St & Monroe St? ?? ??? 41.880456? ?? ???-87.653929
Ada St & Washington Blvd? ?? ??? 41.88283? ?? ??? -87.661206
Adler Planetarium? ?? ??? 41.866095? ?? ???-87.607267
Albany Ave & 26th St? ?? ??? 41.844475? ?? ???-87.702013
Albany Ave & Bloomingdale Ave? ?? ???41.914027? ?? ???-87.705126
Artesian Ave & Hubbard St? ?? ??? 41.889492? ?? ???-87.688219
table2
from_station_name? ?? ??? to_station_name
Aberdeen St & Jackson Blvd? ?? ?? ?Aberdeen St & Monroe
Artesian Ave & Hubbard St? ?? ??? Ada St & Washington Blvd
根據(jù)table1的經(jīng)緯度計算table2兩點之間的距離應(yīng)該怎么操作?
解決方法:
select x.name,y.name , GEOGRAPHY::Point(x.latitude , x.longitude , 4326).STDistance(GEOGRAPHY::Point(y.latitude , y.longitude , 4326))
from table1 as x,table1 as y;








暫無數(shù)據(jù)