當前位置:成語大全網 - 新華字典 - 如何修改數據庫表中的某壹個字段的值

如何修改數據庫表中的某壹個字段的值

修改方法:

使用update語句。語法是:update table_name set column = value[, colunm = value...] [where condition];

[ ]中的部分表示可以有也可以沒有。

例如:update students set stu_name = "zhangsan", stu_gender = "m" where stu_id = 5;

具體操作方法:

a lter table table_name add xxoo number(4) default 0 ;

因此 不僅要修改字典, 還要刷新全部數據.

1) 在ALTER sql中有帶缺省值,ORACLE 會直接刷新全部的記錄。

2) 在ALTER sql中沒有帶缺省值,ORACLE 只會影響到後來的記錄。

1 2 3 4 alter table table_name add xxoo number(4) default null; Table altered,Executed in 0.062 seconds。

帶有default null 就可以了?,1 2 3 4 alter table table_name add xxoo number(4) default 0;Table altered,Executed in 1.625 seconds,原來的話 要更新所有的行, 會導致UNDO 段占用

使用語句Alter table a add test number(10) default 0;更新壹個大表中字段時,表有四個分區,數據達到幾十億行,增加壹個字段竟然要幾個小時的時間,修改語句加上Nologging ,怎麽沒有作用呢?去找是不是哪有鎖了呢,使用語句 select *。