I am a beginner with PostgreSQL and have two tables A and B, both with multiple columns, including a point column (geom):
TableA includes a given 'ID', geom, etc , TableB is a "DB" of locations with a 'name' column, geom, etc...
Need to find for each TableA.id what is the the 'name' (row columns) and distance of the closest location in TableB.
already could calculate the distance between all points of TableA and TableB with :
But the best could build so far, is a select query where provides for each
TAbleA.ID all distances and respective names from TableB - does not find the minimum for each ID only.
While needed to have the new calculated columns (distance and name) added to Table A.
It is not yet clear to me how to work with data output when using "select" vs an actual table data output. or use of views.