I am trying to insert values from table2 to table1 where addressB matches addressA. My attempt so far is the code below. The query seems to insert new blank records to the table1 instead what I want it to do. Can someone please tell me if this query is correct?
INSERT INTO database1.table1 (name)
select database2.table2.distName
from database2.table2
left join database1.table1
On database2.table2.addressB = database1.table1.addressA
where database2.table2.addressB = database1.table1.addressA
My sql fiddle
http://sqlfiddle.com/#!9/aca3e/2
a_distName2
field is populated in table2?