All pastes #492116 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-17 00:48 UTC
rendered paste body
select a.pop, a.x, a.y, a.village,a.player, distance, sum(a.pop) as total
from x_world AS a
join
(select distinct b.player, SQRT(POW(b.x-73,2)+POW(b.y-5,2)) AS distance from x_world b order by distance asc limit 200)
AS c on a.player = c.player
group by a.pop
order by distance, a.player;