如何闪回表中所有行的特定列?
例如,给定这张表:
select * from t as of scn 1201789714628;
a b
- -
x 1
y 2
z 3
select * from t;
a b
- -
x 4
y 5
z 6
我可以闪回特定行中的列,如下所示:
update t set b = (select b from t as of scn 1201789714628 where a='x') where a='x';
select * from t;
a b
- -
x 1
y 5
z 6
但我无法弄清楚将所有行的 b 设置为其先前值的语法。
update t t1 set b = (select b from t as of scn 1201789714628) t2 where t1.a = t2.a;
Error at Command Line:11 Column:60
SQL Error: ORA-00933: SQL command not properly ended