i have two tables like:
table 1:
|A|B|C|D|E|F|G|H|I|J|
table 2:
|A|C|D|E|G|H|J|K|L|M|N|O|P|
i have to copy some columns from table 2 to table 1.
What i try is:
INSERT INTO `table 1` (`C`,`D`,`E`,`G`,`J`)
SELECT `C`,`D`,`E`,`G`,`J` FROM `table 2` WHERE
`table 1`.`A` = `table 2`.`A`;
but it result :
#1054 - Unknown column 'table 1.A' in 'where clause'
where is the error? can someone help me?
MY ERROR IS THAT I DON’T HAVE TO INSERT NEW ROWS, BUT UPDATE THE ROWS THAT MATCH THE COLUMN A… in which way i have to edit my query? thanks!
Try this::
Edited::
If you only need to update then ::