Your cart
  • IMG
    {{cart_item.name}}
    {{cart_item.variation_attribute_name}}: {{cart_item.variation_attribute_label}}
    {{cart_item.item_unit}}: {{ setCurrency(cart_item.price)}}
    {{ setCurrency(cart_item.price*cart_item.quantity)}}
    Invalid quantity more than stock
Total :
{{setCurrency(cart.sub_total)}}

There is no item in the cart. If you want to buy, Please click here.

ALTER TABLE DROP Column

Oracle Database Basic Course

Created by :
Database, Oracle
course
Programming, Software and application
1739
2020-12-07 03:13:23

Simply, to drop column from a table, we need to use following statement

ALTER TABLE table_name DROP COLUMN column_name;  


Many time, if we use above statement to drop column from a big table, it can be time and resource consuming. Therefore, we typically drop the column logically by using the ALTER TABLE SET UNUSED COLUMN statement as follows:


ALTER TABLE table_name 
SET UNUSED COLUMN column_name;

Once you execute the statement, the column is no longer visible for accessing.


During the off-peak hours, you can drop the unused all columns physically using the following statement:


ALTER TABLE table_name
DROP UNUSED COLUMNS;


If you want to reduce the amount of undo logs accumulated, you can use the CHECKPOINT option that forces a checkpoint after the specified number of rows has been processed.


ALTER TABLE table_name 
DROP UNUSED COLUMNS CHECKPOINT 250;


To drop multiple columns, you use the statement below:

ALTER TABLE table_name
DROP (
  column_name_1,
  column_name_2
);