我收到以下錯誤「發生了無效的浮點操作。」當我運行此查詢:計算距離時收到以下錯誤與我的查詢
SELECT PolID, LocID, Address, City, StateCode, OrigGeoLat, OrigGeoLong, NewGeoLat, NewGeoLong,
acos(sin(radians(OrigGeoLat)) * sin(radians(NewGeoLat)) +
cos(radians(OrigGeoLat)) * cos(radians(NewGeoLat)) *
cos(radians(OrigGeoLong - NewGeoLong))) * 6372.8 as Distance
FROM zzGeoDataTMP
所有* geoLat和*的geoLong數據定義爲數字(18,10)。當我運行查詢時,我開始獲取數據,然後在特定行數據上出現錯誤。例如,下面的一行只拋出一旦ACOS函數被調用上述異常:
OrigGeoLat|OrigGeoLong|NewGeoLat|NewGeoLong
---------------------------------------------
32.9364620|-80.0411000|32.9364620|-80.0411000
預先感謝任何見解這麼多,你可能能夠幫助!
有沒有原因你沒有使用'geography'類型? – AakashM 2012-07-10 07:55:26