Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Format : LIMIT a - 1, b - (a - 1)
- ROUND(lat/lon, n)
- ORDER BY city DESC(ra) OR ASC(al)
- */
- SELECT ROUND(MAX(SQRT(POW(x1 - x2, 2) + POW(y1 - y2, 2))), 4),
- ROUND(MIN(SQRT(POW(x1 - x2, 2) + POW(y1 - y2, 2))), 4)
- FROM ((SELECT id, ROUND(lat, 3) x1, ROUND(lon, 3) y1
- FROM citytable GROUP BY x1, y1 ORDER BY city DESC, id LIMIT 5, 9) AS tt1
- JOIN
- (SELECT id, ROUND(lat, 3) x2, ROUND(lon, 3) y2
- FROM citytable GROUP BY x2, y2 ORDER BY city DESC, id LIMIT 5, 9) AS tt2
- ON tt1.id<>tt2.id AND tt1.id<tt2.id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement