Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select *, sqrt((a.x-b.x)^2 + (a.y-b.y)^2) as Distance
- from MyData a
- Join MyData b
- on a.x <> b.x and a.y <> b.y
- Select top 1 *, sqrt((a.x-b.x)^2 + (a.y-b.y)^2) as Distance
- from MyData a
- Join MyData b
- on a.x <> b.x and a.y <> b.y
- order by Distance desc
Add Comment
Please, Sign In to add comment