I created a table with 85 columns but I missed one column. The missed column should be the 57th one. I don\'t want to drop that table and create it again. I\'m looking to ed
SET
@column_name =(
SELECT COLUMN_NAME
FROM
information_schema.columns
WHERE
table_schema = 'database_name' AND TABLE_NAME = 'table_name' AND ordinal_position = 56
);
SET
@query = CONCAT(
'ALTER TABLE `table_name` ADD `new_column_name` int(5) AFTER ',
@column_name
);
PREPARE
stmt
FROM
@query;
EXECUTE
stmt;
DEALLOCATE
stmt;