如何在sqlite中获取sqrt [英] how to take sqrt in sqlite
本文介绍了如何在sqlite中获取sqrt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是PHP使用MySQL的查询.任何人都可以将此查询转换为 sqlite 查询吗?
This is the query of PHP using MySQL. can anyone please convert this query to sqlite query?
查询:
select SQRT(POW(latitude, 2) + POW(longitude, 2)) *110 as dist from route
最好的问候,谢谢
推荐答案
我是在 "pascal" 的帮助下完成的.
I have done it with the help of "pascal".
查询变成:
SELECT
*
FROM
(
SELECT
temperature,
climate,
temperatureTime,
photoURL,
(((latitude - 37.331689) * (latitude - 37.331689)) + (longitude - (-122.030731)) * (longitude - (-122.030731))) * (110 * 110) AS dist
FROM
weather
)
AS tab
WHERE
tab.dist <= (1.0 * 1.0);
此查询用于找出我周围 1 公里范围内最近位置的坐标.
This query is used to find out the nearest coordinates of locations around me within 1 KM.
这篇关于如何在sqlite中获取sqrt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文