dorsetdigital

When you run the query, are all the rows null, or just some?

andante

something like this seems like what you are going for: https://stackoverflow.com/questions/725556/how-can-i-merge-two-mysql-tables

Show 1 attachment(s)
Stack Overflow  
How can I merge two MySQL tables?

How can I merge two MySQL tables that have the same structure? The primary keys of the two tables will clash, so I have take that into account.

Hide attachment content
dorsetdigital

It's doesn't help that 'Order' is a reserved word... makes the quoting extremely important

andante

which do you prefer, if the field is defined on both tables?

andante

well a loop seems like a straightforward way to do it, though probably not too efficient

Makreig

it needs to be an upgrade task we can run during dev build

Makreig

yes, there are multiple projects we need to upgrade from ss3 to ss4 that have our custom commerce modules installed

dorsetdigital

Do you need to do this in SQL? Could you export to CSV and import?

Makreig

in ss3 order was the base object and estimate was an extension in ss4 estimate is the base object and the order (now called invoice) is the extension

Makreig

It's upgrading some tables from ss3 to ss4 the tables are different in ss4 so i need to merge the data from both tables and use that data to create new orders