Home > SQL, Technical > DROP columns and set columns unused in Oracle

DROP columns and set columns unused in Oracle

July 27, 2012

DROP COLUMN

——————-

Syntax 1: ALTER TABLE TABLE_NAME DROP COLUMN COLUMN_NAME;

Example 1: ALTER TABLE ORDERS DROP COLUMN O_CODE;

Syntax 2: ALTER TABLE TABLE_NAME DROP(COLUMN_NAME);

Example 2: ALTER TABLE ORDERS DROP(O_CODE);

SET COLUMN UNUSED:

—————————–

Syntax: ALTER TABLE TABLE_NAME SET UNUSED COLUMN COLUMN_NAME;

Example: ALTER TABLE ORDERS SET UNUSED COLUMN O_CODE;

 

DROP UNUSED COLUMNS:

———————————-

ALTER TABLE TABLE_NAME DROP UNUSED COLUMNS;

 

Advertisements
Categories: SQL, Technical
%d bloggers like this: