How can I copy rows from one to another table with a different number of
columns
I have a "unusual" problem on MySQL Syntax.
I have 2 tables:
table1: commodityAttributes and has 6 column
id_commodity,parameter,value,units,type,notes
table2: trade_commodity and has 7 column
id_trade,id_commodity,parameter,value,units,type,notes
note: primary key is hidden on both of tables
What I want, is copy all column from table1 to table2 but also create
value for id_trade in table2.
How can I accomplish this? Or is there another tricky? Btw, I am using PHP
and MySQL to work on this task.
Please kind help me, thank you.
No comments:
Post a Comment