我有以下sql查詢當我執行它零行顯示我有feild稱爲距離與值null它,當我執行此查詢距離feild將填充一些數值,但如果我指定條件距離< 2或距離< 10或...顯示相同的結果我可以知道最新的問題。錯誤與SQL查詢中的where子句
SELECT Id,Name1,ZipCode,StreetName,StreetNumber,State1,Lat,
Lng,Keyword,
(6371 * ACOS(COS((12.925432/57.2958))
* COS( (Lat/57.2958) ) * COS((Lng/57.2958) - (77.5940171/57.2958))
+ SIN(12.925432/57.2958) * SIN( Lat/57.2958 ))) AS distance
FROM Business_Details
where (
(StreetName like '%jayanagar%')
and (Keyword like '%plumbing%')
and (distance<3)
)
ORDER BY distance;
接受你以前的問題的一些答案,你將贏得聲譽! – fredley 2010-08-31 12:03:34