I have two MySQL tables: one called Audit and the other Audit2. I need to copy the column names from Audit2 to Audit. For example table Audit has columns 1, 2 and 3 and Audit2 has columns 4, 5 and 6 and I need Audit to have columns 1, 2, 3, 4, 5 and 6.
I tried the following to no success:
ALTER TABLE `Audit` ADD (select `COLUMN_NAME` from information_schema.columns
where table_schema = 'BMS' and `TABLE_NAME` = 'Audit2') (select `DATA_TYPE` from information_schema.columns
where table_schema = 'BMS' and `TABLE_NAME` = 'Audit2') NOT NULL