Dropping Columns
Only with the release of Oracle 8i has it been possible to drop a column
from a table. Prior to this it was neccessary to
drop the entire table and rebuild it. Now you can mark a column as
unused (logical delete) or delete it completely (physical delete).
Logical Delete
On large tables the process of physically removing a column can be very time and resource consuming. For this reason you may
decide to logically delete it:
ALTER TABLE table_name SET UNUSED (column_name);
ALTER TABLE table_name SET UNUSED (column_name1, column_name2);
Once this is done the columns will no longer be visible to the user. If at a later date you have time to physically delete the
columns this can be done by:
ALTER TABLE table_name DROP UNUSED COLUMNS;
On large tables you can reduce the amount of undo logs accumulated by using the CHECKPOINT option which forces a checkpoint
after the specified number of rows has been processed:
ALTER TABLE table_name DROP UNUSED COLUMNS CHECKPOINT 250;
The DBA_UNUSED_COL_TABS view can be used to view the number of unused columns per table.
Physical Delete
To physically drop a column you can use one of the following syntaxes, depending on whether you wish to drop a single or
multiple columns:
ALTER TABLE table_name DROP COLUMN column_name;
ALTER TABLE table_name DROP (column_name1, column_name2);
Dropping a column from a table will cause all unused columns in that table to be dropped at the same time.
Hope this helps. Regards Tim...
分享到:
相关推荐
Dropping a Collection 12 Programming with the MySQL Document Store Programming Examples Python Example Node.JS Example PHP Example Traditional SQL vs. MySQL Document Store The MySQL Shell and ...
7. **删除(Dropping)** - `df.drop(['Length', 'Height'], axis=1)`:根据列名删除DataFrame的列。 8. **子集选择(Selecting Subsets)** - 可以通过列名或索引来选择DataFrame的子集。 - 例如,`df['a']`选择列'...
Offset columns 23 Completing the grid rows 24 Nesting rows 24 Finishing the grid 26 Fluid container 28 We need some style! 28 There are headings everywhere 30 Playing with buttons 31 [ ii ] More ...
5.4 Assigning Names to Result Columns . . . . . . . . . . . . . . . . . . . . 92 5.5 The Column Specification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 5.6 The User Variable and the ...
- **Hiding Columns or Individual Grades 隐藏列或个别成绩**: 可以隐藏某些列或特定的成绩以保护隐私。 - **Recalculating 重新计算**: 当更改了成绩或设置后,可以选择重新计算总分。 - **Add New Grade Item ...
After dropping the low SNR frames, acoustic features are further post-processed to remove the linear channel effects. Cepstral mean and variance normalization (CMVN) is commonly used for the post-...
The Use of DISTINCT When Selecting Multiple Columns487 Dropping an Unqualified Table 487 The Use of Public Synonyms in a Multischema Database488 The Dreaded Cartesian Product 488 Failure to Enforce ...
columns starting with a negative number to be discarded. Fixed. + Entering a user model with no parameters was allowed when it shouldn't have been. Now, a syntax error is generated. + the Window|...
Table of Contents Introduction....................................................................................................13 Code Examples.........................................................