Oracle如何替换整张表中一列的所有值
第一步(创建临时表)
示例(替换原表中多有的title为“你好”)
create table temp as
select a.id as id,
‘你好’ as title,
a.time as time
from tablename a
注:temp为临时表表名,tablename为正式表名(下同)****
第二步(清空原表数据)
truncate tablename
注:tablename为正式表名
第三步(将临时表数据插入原表)
insert into tablename select * from temp
commit;
第四步(删除临时表)
drop table tablename
第五步(查看表中数据)
select * from tablename
本文介绍了一种在Oracle数据库中替换整张表中一列所有值的方法,包括创建临时表、清空原表数据、将临时表数据插入原表、删除临时表及查看最终结果等步骤。
2万+

被折叠的 条评论
为什么被折叠?



