Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Format : LIMIT s-1, t - (s - 1)
- SELECT COALESCE(ROUND(AVG(val), 4), 'NULL')
- FROM (SELECT CASE WHEN 'lon' = 'lat' THEN lat ELSE lon END AS val, @rownum:=@rownum+1 AS idx, @total_rows:=@rownum
- FROM citytable x, (SELECT @rownum:=0) r
- WHERE CASE WHEN 'lon' = 'lat' THEN x.lat ELSE x.lon END is NOT NULL
- AND id % 10 = 8 ORDER BY CASE WHEN 'lon' = 'lat' THEN x.lat ELSE x.lon END ASC LIMIT 34, 1667) AS y
- WHERE y.idx IN(FLOOR((@total_rows + 1) / 2), FLOOR((@total_rows + 2) / 2));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement