Julian Williams
Julian Williams

Reputation: 99

Delete a column in table (PhpMyAdmin/HeidiSQL)

I would like to know how to delete a column in a table, without deleting the rest of the columns.

Upvotes: 1

Views: 5143

Answers (2)

Mohsen Gorzin
Mohsen Gorzin

Reputation: 186

If this column has foreign key you have to go in "Structure" tab, click on "see relational view" below the fields. Here you can remove the foreign keys by selecting an empty value in the dropdown. After that you should drop column using following comment : ALTER TABLE 'tableName' DROP COLUMN 'columnName';

Upvotes: 1

Bearzi
Bearzi

Reputation: 558

ALTER TABLE NameofTable DROP COLUMN ColumnName;

Upvotes: 3

Related Questions