MySQL calculate distance between two latitude/longitude coordinates

–Returns the distance in kilometers, assuming an earth radius of 6,371 km.

SELECT D.idx,D.name,( 6371 * ACOS( COS( RADIANS(C.latitude) ) * COS( RADIANS( D.latitude ) ) * COS( RADIANS( D.longitude ) - RADIANS(C.longitude) ) + SIN( RADIANS(C.latitude) ) * SIN( RADIANS( D.latitude ) ) ) ) AS kms
FROM dealers D,cities C
	GROUP BY D.idx
	ORDER BY kms 

// you need to have co-ordinates of 2 places (in this case it is dealer location and city)

241 thoughts on “MySQL calculate distance between two latitude/longitude coordinates

  1. Pingback: Google
  2. Pingback: 토토사이트
  3. Pingback: 사다리사이트
  4. Pingback: 먹튀검증
  5. Pingback: 안전놀이터
  6. Pingback: realistic vibrator
  7. Pingback: first dildo
  8. Pingback: Google
  9. Pingback: beast tv apk
  10. Pingback: store
  11. Pingback: double headed dong
  12. Pingback: порно чат
  13. Pingback: 메이저공원
  14. Pingback: 사설토토
  15. Pingback: cursos online
  16. Pingback: fbv cursos online
  17. Pingback: fishing equipment
  18. Pingback: bondage sex kit
  19. Pingback: kegel massager
  20. Pingback: bunny vibrator
  21. Pingback: printers
  22. Pingback: FIFA 19 Coins
  23. Pingback: Chicago SEO
  24. Pingback: Chicago SEO
  25. Pingback: detox tea
  26. Pingback: curso online
  27. Pingback: chwilówki
  28. Pingback: iphone repair
  29. Pingback: male sex sleeve
  30. Pingback: Google
  31. Pingback: bbw dildo
  32. Pingback: dildo
  33. Pingback: milking toy
  34. Pingback: website
  35. Pingback: workfromhome2019
  36. Pingback: los angeles seo
  37. Pingback: xxx
  38. Pingback: Anal
  39. Pingback: Lawn
  40. Pingback: penis enlargement
  41. Pingback: anal plugs reviews
  42. Pingback: strap on
  43. Pingback: 188bet
  44. Pingback: fun88
  45. Pingback: play free pc games
  46. Pingback: rijpe vrouw
  47. Pingback: webcamsex
  48. Pingback: торб
  49. Pingback: cameras ao vivo
  50. Pingback: rencontres sexe
  51. Pingback: anal plug set
  52. Pingback: gay bum cleaning
  53. Pingback: Waterbaan prijs
  54. Pingback: Acronis Cracks
  55. Pingback: bullet vibe
  56. Pingback: couples sex toys
  57. Pingback: pc games download
  58. Pingback: Times of India
  59. Pingback: cock gay
  60. Pingback: shemale sexdate
  61. Pingback: filles coquin
  62. Pingback: sexe webcam
  63. Pingback: first time anal
  64. Pingback: the thrusting vibe
  65. Pingback: real penis dildo
  66. Pingback: masturbator
  67. Pingback: lenovo h50 manual
  68. Pingback: 6.3.10w2
  69. Pingback: sex toy store
  70. Pingback: prostate vibrator
  71. Pingback: silicone dildo
  72. Pingback: anal douche
  73. Pingback: anal butt plugs
  74. Pingback: Avandra-100
  75. Pingback: AutoCAD Discount
  76. Pingback: ed pump
  77. Pingback: dp ring
  78. Pingback: ben wa balls
  79. Pingback: big dildo review
  80. Pingback: vibrating kegels
  81. Pingback: pleasure panty
  82. Pingback: blockchain advisor
  83. Pingback: satta king
  84. Pingback: double bullet vibe
  85. Pingback: clit tickler
  86. Pingback: Ashlyn brooke mold
  87. Pingback: double dong
  88. Pingback: g spot toy
  89. Pingback: bullet vibrator
  90. Pingback: dildo set
  91. Pingback: male masturbator
  92. Pingback: porn
  93. Pingback: porn land
  94. Pingback: g-spot vibrator
  95. Pingback: penis sex toy
  96. Pingback: suction cup dildo
  97. Pingback: pocket stroker
  98. Pingback: legal
  99. Pingback: ssru.ac.th
  100. Pingback: bunny vibrator
  101. Pingback: male masturbators
  102. Pingback: big black dildo
  103. Pingback: vibrator for her
  104. Pingback: bondage toys
  105. Pingback: Goedkoopste barbie
  106. Pingback: porn land
  107. Pingback: giant dildo orgasm
  108. Pingback: sex costume
  109. Pingback: hundejakke
  110. Pingback: Julia Ann
  111. Pingback: Pakistani Suits
  112. Pingback: sexboer
  113. Pingback: geile sex filmpjes
  114. Pingback: porno files
  115. Pingback: gratis films
  116. Pingback: iptv 7+
  117. Pingback: liteblue login
  118. Pingback: liteblue
  119. Pingback: homemade vibrator
  120. Pingback: 7 inches dildo
  121. Pingback: virtual visa card

Leave a Reply