I would like to update the columns of Table1 with the values from Table2 where postcode value from table1 matches table2.
It must work with multiple rows as some rows have same postcode, latitude and longitute data but different door number.
I am using the statement shown below. I am trying to update table1 with latitude and longitue data from table2 for matching postcode.
update table1
set latitude = (select latitude from table2 where table1.postcode = table2.postcode);
I am getting error message :
Subquery returned more than 1 value.
Table1
id Postcode Street City Latitude Longitude
1 N76PP 44 Camden Road London NULL NULL
2 N76PP 45 Camden Road London NULL NULL
3 N76PP 46 Camden Road London NULL NULL
Table2
id Postcode Street City Latitude Longitude
1 N76PP 44 Camden Road London 51.5166 -0.052787
2 N76PP 45 Camden Road London 51.5166 -0.052787
3 N76PP 46 Camden Road London 51.5166 -0.052787