gpt4 book ai didi

php - 如何获得<500的距离?

转载 作者:行者123 更新时间:2023-11-29 07:08:00 25 4
gpt4 key购买 nike

这是我使用纬度经度值计算距离的查询。

SELECT mm.mem_id, mm.profilenam, mm.photo_thumb, mm.city, mm.zip, mm.country, mm.state, ( 3956 *2 * ASIN( SQRT( POWER( SIN( ( 34.1012181 - ABS( latitude ) ) * PI( ) /180 /2 ) , 2 ) + COS( 34.1012181 * PI( ) /180 ) * COS( ABS( latitude ) * PI( ) /180 ) * POWER( SIN( (
ABS( - 118.325739 ) - ABS( longitude ) ) * PI( ) /180 /2 ) , 2 ) ) )
) AS distance
FROM members AS mm
WHERE mm.profile_type = 'C'
ORDER BY distance
LIMIT 0 , 10

我希望距离 < 500 但是当我查询时... <500 AS 距离,它不起作用我怎样才能得到最终的查询。

最佳答案

你试过吗

SELECT mm.mem_id, mm.profilenam, mm.photo_thumb, mm.city, mm.zip, mm.country, mm.state, ( 3956 *2 * ASIN( SQRT( POWER( SIN( ( 34.1012181 - ABS( latitude ) ) * PI( ) /180 /2 ) , 2 ) + COS( 34.1012181 * PI( ) /180 ) * COS( ABS( latitude ) * PI( ) /180 ) * POWER( SIN( (
ABS( - 118.325739 ) - ABS( longitude ) ) * PI( ) /180 /2 ) , 2 ) ) )
) AS distance
FROM members AS mm
WHERE mm.profile_type = 'C'
HAVING distance<500

关于php - 如何获得<500的距离?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6198962/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com