Oracle Drop Column

We can use DROP COLUMN with ALTER tag to delete a column from a table.

Considering the below table. We can see that there are two columns that contain NULL values.

alter table drop column oracle

To remove those columns that contain NULL values, refer below:

1. Oracle Drop Single Column

Syntax:

ALTER TABLE table_name
DROP COLUMN column_name ;

Example:

ALTER TABLE Stu
DROP COLUMN lname;

Output:

drop column from table in oracle example

After running the Select command we will get the output as follows:

Oracle Drop Single Column example

2. Oracle Drop Multiple Columns

Syntax:

ALTER TABLE table_name
DROP( column1, column2); 

Example:

ALTER TABLE Stu
DROP( max_Marks,lname); 

Output:

Oracle Drop Multiple Columns example

The final table with which we are left is shown below, you can observe column max_Marks and lname does not exist in table now.

Oracle Drop Multiple Columns example