mirror of
https://github.com/openvk/openvk
synced 2024-12-26 02:21:25 +03:00
11 lines
236 B
Text
11 lines
236 B
Text
|
SELECT *,
|
||
|
SQRT(
|
||
|
POW(69.1 * (? - geo_lat), 2) +
|
||
|
POW(69.1 * (? - geo_lon) * COS(RADIANS(geo_lat)), 2)
|
||
|
) AS distance
|
||
|
FROM Posts
|
||
|
WHERE id <> ?
|
||
|
HAVING distance < 1 AND distance IS NOT NULL
|
||
|
ORDER BY distance
|
||
|
LIMIT 25;
|