Advertisement
mosiyash

Запрос на координаты

Sep 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select
  2.   profile.id,
  3.   min(
  4.       round(
  5.           (6371 * acos(
  6.               cos(radians(54.981065)) *
  7.               cos(radians(profile.lat::FLOAT)) *
  8.               cos(radians(profile.lon::FLOAT) - radians(82.872446)) +
  9.               sin(radians(54.981065)) *
  10.               sin(radians(profile.lat::FLOAT))
  11.           ))::FLOAT,
  12.           3
  13.       )
  14.   ) as distance
  15. from profile
  16. where profile.lat is not null and profile.lon is not null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement