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)

398 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
  122. Pingback: cvthl
  123. Pingback: beach
  124. Pingback: hundebur
  125. Pingback: sex toy collection
  126. Pingback: walmartone
  127. Pingback: www.hotmail.fr
  128. Pingback: pink vibrator
  129. Pingback: bondage gear
  130. Pingback: wand massager
  131. Pingback: best anal sex lube
  132. Pingback: podcast
  133. Pingback: BWI transportation
  134. Pingback: vibrator reviews
  135. Pingback: good blow job
  136. Pingback: cock rings
  137. Pingback: 바카라사이트
  138. Pingback: Hotmail Sign In
  139. Pingback: Hotmail login
  140. Pingback: 15% minoxidil
  141. Pingback: internet marketing
  142. Pingback: briefs
  143. Pingback: his and hers toys
  144. Pingback: penis vibrator
  145. Pingback: iraniporn
  146. Pingback: MIDE-675
  147. Pingback: mp3 download
  148. Pingback: security
  149. Pingback: nigerian mp3
  150. Pingback: pppd 780
  151. Pingback: SSNI-542
  152. Pingback: glass anal plugs
  153. Pingback: anal starter kit
  154. Pingback: Instagram Likes
  155. Pingback: south coast seo
  156. Pingback: gay dildo fuck
  157. Pingback: best anal douches
  158. Pingback: rctd 260
  159. Pingback: big wand massager
  160. Pingback: btc to neteller
  161. Pingback: stiiizy pods
  162. Pingback: Eweka
  163. Pingback: minyak kelapa VCO
  164. Pingback: one.walmart.com
  165. Pingback: bullet for woman
  166. Pingback: ginger dank
  167. Pingback: Packwoods
  168. Pingback: Dank Vapes
  169. Pingback: baking cakes kenya
  170. Pingback: Order marijuana
  171. Pingback: Tramadol Sale
  172. Pingback: ABP 897
  173. Pingback: runelite
  174. Pingback: mygiftcardsite.com
  175. Pingback: Beautiful t shirts
  176. Pingback: MEYD 529
  177. Pingback: anal toys
  178. Pingback: Ioe business
  179. Pingback: Proshow Gold Crack
  180. Pingback: sex restraints
  181. Pingback: bondage cuffs
  182. Pingback: gay lubricant
  183. Pingback: dank vapes
  184. Pingback: IPX-369
  185. Pingback: Judi Slot Online
  186. Pingback: gold investments
  187. Pingback: SEO Vancouver
  188. Pingback: PPPD-789
  189. Pingback: daftar joker123
  190. Pingback: best female toys
  191. Pingback: GVG 941
  192. Pingback: Juhu Escorts

Leave a Reply