Reputation: 727
I am using postgres and I have the following two tables. I would like to update the distinct_network_point table with the altitude value taken from the altitude_of_point table joining them on the id value.
The following is the distinct_network_point table:
The following is the altitude_of_point table:
How it shall be the structure of the sql query to do the job?
Upvotes: 2
Views: 122
Reputation: 4391
I hope it helps:
UPDATE distinct_network_point
SET altitude = altitude_of_point.altitude
FROM altitude_of_point
WHERE distinct_network_point.id= altitude_of_point.id
Upvotes: 2
Reputation: 1
UPDATE distinct_network_point
SET altitude = altitude_of_point.altitude
FROM distinct_network_point, altitude_of_point
WHERE distinct_network_point.id= altitude_of_point.id
Upvotes: 0