Dropping multiple columns in MySQL

Is it possible to drop numerous columns from a table at once in MySQL?

The answer is Yes.

Here is the syntax and example:

ALTER TABLE `tableName`
DROP COLUMN Col1,
DROP COLUMN Col2,
DROP COLUMN Col3,
….;

ALTER TABLE `tbOrdersDetail`
DROP COLUMN OrderID,
DROP COLUMN ProductID;

Leave a Reply