I want to add a new column to mysql table, but I want to ignore adding a column if the column already exists
I am currently using
ALTER IGNORE TABLE `db`.`tablename` ADD COLUMN `column_name` text NULL;
but this causes an error: "ERROR 1060 (42S21): Duplicate column name 'column_name'"
although I use IGNORE, this does not work
I want this to work using a regular SQL statement instead of a stored procedure
source
share