Okay basically, I have 2 tables which have over 2,000 records:
I have Table A which has the following fields:
address, zip, state, country, ID(this is a primary Key)
I have Table B which has the following fields:
address, zip, state, country, ID(this is a primary Key), + 10 other fields.
I need to import all the fields from Table A into Table B. All the 10 fields in Table B are populated so I can not lose this data. The ID is the only thing that matches both tables.
The field structure from both tables are the same, so if needed Table A can overwrite all the data in Table B only pertaining to the fields being copied over.
I am trying to do this via phpmyadmin using an SQL statement. I tried to export Table A and import it into Table B but it is not working and I get timeout errors.
I've googled for over an hour but even though I find similar questions.. I can not find my exact question and to be honest I am pretty lost.
Any help would be much appreciated.
Thank you both for your replies, I used the code below and it worked perfect! Thank you!
set tblB.colA = (select tblA.colA from tblA where tblA.ID = tblB.ID)
you will need a set...... for each column you want to update.
ON tableB.id = tableA.id
SET tableB.address = tableA.address
, tableB.zip = tableA.zip
, tableB.state = tableA.state
, tableB.country = tableA.country