I have 2 tables
tb1
OLD_id | East | North
1 | 1000 | 2000
tb2
NEW_id | East | North
4000 | 1009 | 1995
For all records in “tb1” I need to find all records from “tb2” that match the following conditions
tb2.East between (tb1.East - 10) and (tb1.East + 10)
tb2.North between (tb1.North - 10) and (tb1.North + 10)
Output
OLD_id | Matching NEW_ID's | East Difference | North Difference
1 | 4000 | 9 | -5
Try this one –