通过当前用户的经纬度,查询附近的店铺

SELECT
[RoomNumber]
,[BedNumber]
,[PublicArea]
,[Discount]
,[RenPaymentMethod]
,[ElevatorNumber]
,[ParkingSpace]
,[CustomerReamk]
,[Longitude]
,[Latitude],
ROUND(
6378.138 * 2 * ASIN(
SQRT(
power(
SIN(
(
40.0497810000 * PI() / 180 - Latitude * PI() / 180
) / 2
),
2
) + COS(40.0497810000 * PI() / 180) * COS(Latitude * PI() / 180) * power(
SIN(
(
116.3424590000 * PI() / 180 - Longitude * PI() / 180
) / 2
),
2
)
)
) * 1000
,0) AS juli
FROM
PF_Projects
ORDER BY
juli ASC




SELECT[RoomNumber]
,[BedNumber]
,[PublicArea]
,[Discount]
,[RenPaymentMethod]
,[ElevatorNumber]
,[ParkingSpace]
,[CustomerReamk]
,[Longitude]
,[Latitude],SQRT(power(111.2 * (Latitude - 40.0497810000), 2) + power(111.2 * (116.3424590000 - Longitude) * COS(Latitude / 57.3), 2)) AS distance FROM PF_ProjectsORDER BY
distance ASC

    推荐阅读