Robert Robert - 1 year ago 75
MySQL Question

mysql add column added question mark after name

I added a column to an existing mysql table using:

ALTER TABLE tablename ADD columnname varchar(10) AFTER anothercolumnname;

When I did a

DESCRIBE tablename;

The added column looked like


I am unable to drop the column to try and re-add it, and after I did this I realized I did not use quotes for the names. Is there any way to remove that column? Thank you for any help

Answer Source

The following should remove the column; use bacticks to escape the table name:

ALTER TABLE tablename DROP column `columnname?`;

But are you certain that you did not accidentally enter a question mark when you added the column?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download