I have one table with 20 columns that I need to transfer to a new table with 25 columns. I was wonder if there is any possibility to do so? I will much appreciate any source that will lead me to solution. Thank you so much for your time and help.
I will make a short example below:
table.1 includes, let's say 4 columns in this order: t1.First_name, t1.last_name, t1.Phone_number, t1.Address
and I want to transfer this data to Table.2 that includes these columns in this order: t2.First_name, t2.Last_name, t2.Gender, t2.Phone_number, t2.Phone_type, t2.Address
INSERT INTO table2 ( First_name, Last_name, Gender, Phone_number, Phone_type, Address)
SELECT First_name, last_name, 'M', Phone_number, 'cell', Address
FROM table1
For columns that don't exist in source table you need to provide default values or NULL, and update them later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With