Drop columns in an Oracle table

The following example demonstrates how it could be done.

alter table schema1.my_table drop column unused_field;

There is also an alternative syntax that could be used to drop multiple fields at once.

alter table schema1.my_table drop (unused_field); -- Dropping one field only
alter table schema1.my_table drop (unused_field1, unused_field2); -- Dropping two fields

In the second example, if you need to drop more than two fields, just keep adding them within the parenthesis, separated by commas.

Leave a Reply

Your email address will not be published.