sql经纬度查询
2017-04-08 14:38
106 查看
查询某一坐标附近1公里内的信息
select * from parking
where pa_examine=1 and pa_yes=1 and sqrt(
(
((#pa_longitude#-pa_longitude) * PI () * 12656 * cos
(((#pa_latitude# + pa_latitude)/2) * PI
()/180)/180)
*
((#pa_longitude#-pa_longitude) * PI () * 12656 * cos (((#pa_latitude#
+ pa_latitude)/2) * PI
()/180)/180)
)
+
(
((#pa_latitude# -pa_latitude)* PI
()* 12656/180)
*
((#pa_latitude# -pa_latitude)* PI ()* 12656/180)
)
)<=1
查询距离某一左边最近的20个信息
order by ACOS(SIN((#ho_longitude# * 3.1415) / 180 )
*SIN((ho_latitude * 3.1415) / 180 ) +COS((#ho_longitude# * 3.1415) / 180
) * COS((ho_latitude * 3.1415) / 180 ) *COS((#ho_latitude# * 3.1415) /
180 - (ho_longitude * 3.1415) / 180 ) ) * 6380 asc limit 20
select * from parking
where pa_examine=1 and pa_yes=1 and sqrt(
(
((#pa_longitude#-pa_longitude) * PI () * 12656 * cos
(((#pa_latitude# + pa_latitude)/2) * PI
()/180)/180)
*
((#pa_longitude#-pa_longitude) * PI () * 12656 * cos (((#pa_latitude#
+ pa_latitude)/2) * PI
()/180)/180)
)
+
(
((#pa_latitude# -pa_latitude)* PI
()* 12656/180)
*
((#pa_latitude# -pa_latitude)* PI ()* 12656/180)
)
)<=1
查询距离某一左边最近的20个信息
order by ACOS(SIN((#ho_longitude# * 3.1415) / 180 )
*SIN((ho_latitude * 3.1415) / 180 ) +COS((#ho_longitude# * 3.1415) / 180
) * COS((ho_latitude * 3.1415) / 180 ) *COS((#ho_latitude# * 3.1415) /
180 - (ho_longitude * 3.1415) / 180 ) ) * 6380 asc limit 20
相关文章推荐
- mysql经纬度查询并且计算2KM范围内附近用户的sql查询性能优化实例教程
- sql语句查询经纬度范围
- sql语句查询经纬度范围
- 根据经纬度查询附近企业 | SQL
- sql语句查询经纬度范围 Oracle
- sql语句查询经纬度范围
- mysql经纬度查询并且计算2KM范围内附近用户的sql查询性能优化实例教程
- sql语句查询经纬度范围
- sql语句查询经纬度范围
- sql语句查询经纬度范围(转载,源链接失效)
- sql语句查询经纬度范围
- mysql 下 计算 两点 经纬度 之间的距离 含具体sql语句以及伪列作为查询条件实现
- sql语句查询经纬度范围
- sql语句查询经纬度范围
- mysql的sql语句根据经纬度查询距离排序
- 使用SQL语句查询经纬度之间的距离和一定范围内的数据
- GPS定位,根据经纬度查询附近地点的经纬度-sql方法实现
- SQL查询语句优化
- 网站后台登录aspcms 提示错误号:-2147467259,错误描述:操作必须使用一个可更新的查询。sql=update AspCms_Content set TimeStatus=0 where TimeStatus=1 and Timeing <= 解决方法。
- 由将SQL查询结果转化为pojo的想到的