Home / Databases / MySQL / How can I delete or remove a field from a mysql table?
How can I delete or remove a field from a mysql table?
Last updated: 06/30/2009
To keep your tables clean and easy to decipher, it's advisable to delete any columns that are no longer used. For instance, if you stop using the field "fax" in table "employee", you would do something like this:
alter table employee drop fax;
That's all you need. The field will be deleted, and your table will be leaner. Of course, make sure any queries referencing that field are updated to reflect the change.