What is the easiest way to accomplish this.
I have two similar tables in two databases db1.T1 and db2.T1
They are supposed to have identical structure/fields but are off by a few columns now.
I want to copy a few records from one table to the other so i used CTAS
insert into db2.T1 select * from db1.T1;
it failed because of those a few extra columns in db1.T1 which are in the middle of the table.
The tables has about 150 columns. i can do the copy by selecting each column but it is tedious.
1) is ther a way to create the select dynamically from data dictionary so it will work.
2) what would be the best way to get the table structure match by adding those missing columns.