How to Drop Multiple Columns with ALTER TABLE in SQL
I was looking for a concise way to drop multiple columns while using ALTER TABLE
in SQL.
There are subtle differences depending on the Database Management System (DBMS).
Potential Solutions
MySQL
ALTER TABLE table_name DROP column_name1, DROP column_name2;
PostgreSQL
ALTER TABLE table_name DROP COLUMN column_name1, DROP COLUMN column_name2;
Oracle
ALTER TABLE table_name DROP (column_name1, column_name2);
MS SQL Server
ALTER TABLE table_name DROP COLUMN column_name1, column_name2