I have two tables A and B. I want update table A with all entries from table B. Tables have different structures but 2 colums that I want to copy are the same. Help brother out.
Need MySQL help with short query..
Collapse
X
-
Tags: None
-
If you're ever scratching your head about a command, do a search for "COMMAND mysql" and the mysql site is usually the first result.
I presume you want something like this...
INSERT INTO table_B (column1,column2) SELECT column1,column2 FROM table_A;
Back up your data first. -
sorry, I should have added that I need to do UPDATE not insert because there's a default value in that field already. I looked all over but still can't figure out what Im doing wrong.If you're ever scratching your head about a command, do a search for "COMMAND mysql" and the mysql site is usually the first result.
I presume you want something like this...
INSERT INTO table_B (column1,column2) SELECT column1,column2 FROM table_A;
Back up your data first.Comment
-
-
Comment


Comment