create table mt_apply_101231 as select * from mt_apply ;update mt_apply m---31060
set m.admit_date = to_date('20111231','yyyy-mm-dd') where m.valid_flag = '1';现在执行了这些,COMMIT了。
现在要恢复这个。。
update MT_APPLY ma
set ma.apply_date = (select mae.apply_date
from mt_apply_101231 mae
where mae.serial_apply = ma.serial_apply and mae.valid_flag=1)
WHERE ma.serial_apply in
(select mae.serial_apply
from mt_apply_101231 mae
where mae.serial_apply = ma.serial_apply and mae.valid_flag=1)
这样行吗?
set m.admit_date = to_date('20111231','yyyy-mm-dd') where m.valid_flag = '1';现在执行了这些,COMMIT了。
现在要恢复这个。。
update MT_APPLY ma
set ma.apply_date = (select mae.apply_date
from mt_apply_101231 mae
where mae.serial_apply = ma.serial_apply and mae.valid_flag=1)
WHERE ma.serial_apply in
(select mae.serial_apply
from mt_apply_101231 mae
where mae.serial_apply = ma.serial_apply and mae.valid_flag=1)
这样行吗?
解决方案 »
- oracle alter system,database,session区别?
- Oracle 8.1.6 如何查找字符串中是否含有小写字母?
- 动态 列转行 or 行转列 请教
- oracle中的表
- 关于Oracle的序列问题,请各位大虾们帮忙,高分相送
- 如何将一个表更新前和更新后的记录,插入到另外一个表中?
- 调用存储过程出错现象:在存储过程中使用not in ()方式引用传入字符型值时总是出错。vFCode参数的值应具备什么要求。
- 我这个存储过程该怎么来调用呢?
- 五星级菜鸟问题:有关ora和dbf ★★★★★
- oracle图形界面的怪问题!!!
- 新手求一SQL解决方法
- 存储过程:定义枚举数值,判断是否存在字段名然后遍历相加,返回。
set ma.apply_date = (select mae.apply_date
from mt_apply_101231 mae
where mae.serial_apply = ma.serial_apply and mae.valid_flag=1)
WHERE ma.valid_flag=1
and exists (select 1 from mt_apply_101231 mae
where mae.serial_apply = ma.serial_apply and mae.valid_flag=1)
set ma.apply_date = (select mae.apply_date
from C mae
where mae.serial_apply = ma.serial_apply and mae.valid_flag=1)
WHERE ma.serial_apply in
(select mae.serial_apply
from mt_apply_101231 mae
where mae.serial_apply = ma.serial_apply ) and mae.valid_flag=1
--ormerge into MT_APPLY a using mt_apply_101231 b on(a.serial_apply = b.serial_apply)
when matched then
update set a.apply_date=b.apply_date
where a.valid_flag=1
--or你直接清空数据在插入不可以吗