I think you can get pretty far by using the Distance Calculator tool.
It will calculate the distance between all points in one table to one or more points in another table.
The result can be saved into a new table holding the name/id from the two input tables and the distance between the points.
This also means that you need to create a column with a unique ID for your two tables if they don’t have this already.
You can add a new column of type integer to the tables and update this column with the ROWID (which will assign a counter to each record)
When you have created the result from the Distance calculator you can link the result back to the base table via a join on the Unique ID column:
Select *
From TableB, DistanceTable
Where TableB.B_ID = DistanceTable.B_ID
And TableB.SearchRingDistance < DistanceTable.Distance
The result from the above query should be the records from table B that have a records with their search distance in TableA.
From: mapi...@googlegroups.com <mapi...@googlegroups.com>
On Behalf Of Hemdatt Sharma
Sent: 22. december 2021 07:49
To: MapInfo-L <mapi...@googlegroups.com>
Subject: [MI-L] Mapinfo SQL Query - Calculate the distance and Selection of object from Table A & update Table B based on the search ring distance mentioned in table B
This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mapinfo-l/be8ef16e-fbe1-4315-beff-b8efe011765an%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/06e9b0e9-6660-4719-9fc0-705fb889deb2n%40googlegroups.com.