logo
  • Home
  • Contact
💵
Should I be buying I-Bonds in 2023?
💰
Need a step-by-step guide to opening your Roth IRA?
Buy me a coffee Buy me a coffee
aws c++ career cli css docker finance git java js misc python sql

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

Related in SQL

How to Group By Alias in an AWS Athena SQL Query
How to Group Rows Into Buckets with Count in a SQL Query
How to Get the Average String Length of a Column in MySQL
How to Check If Value Exists in a MySQL Table
How to Query a Table Using MySQL CLI
How to Get All Keys in JSON Object from MySQL
How to Query JSON Objects in MySQL
How to Match Columns that Contain a Substring in SQL
How to Set Up a Free PostgreSQL Database on Heroku
How to Change the Primary Key to Another Column in SQL Server
How to Modify Table to Use Composite Primary Key in MySQL
How to Format a Number with Two Decimal Places in SQLite
How to Order By Multiple Columns in SQL
How to Count the Number of Rows with the Same Value
How to Order a SQL String Column By Its Numeric Value
How to Check if a Column is Null in MySQL
© , LogFetch   âˆ™   Advertise Here   âˆ™   Privacy Policy