这是参考这个问题:Find UK PostCodes close to other UK Post Codes by matching the Post Code String
--User wants to get all postcodes nearby B193SH
-- Postcode = 'B193SH'
-- Latitude = 52.488460
-- Longitude = -1.895690
SELECT [HouseNumber],
[Street],
[Area],
[PostCode],
[Latitude],
[Longitude],
FROM [dbo].[Address]
WHERE ([Latitude] BETWEEN ( 52.488460 - 0.100000 ) AND ( 52.488460 + 0.100000 )) AND
([Longitude] BETWEEN ( -1.895690 - 0.100000 ) AND ( -1.895690 + 0.100000 ))
ORDER BY [PostCode]
GO
执行这个查询,我得到了几个结果。但问题是,纬度/经度的 +/- 0.100000 有什么区别(米/英里)?
我是否应该尝试使用基本邮政编码的前三个字母(即“B19”)来查找相近的邮政编码?
有关我的场景的完整详细信息,请参阅参考问题。
谢谢!