Connor and Chris will both be at AI World from October 12 to October 17 , the premier Oracle conference of 2025. If you're in Vegas, please come say Hi or pop into our sessions
Thanks for the question, Arun Nagaraj.
Asked: January 25, 2018 - 3:37 pm UTC
Last updated: January 26, 2018 - 4:02 pm UTC
Version: 11.2.0.4
Viewed 10K+ times! This question is
update table A set table A.column 1=<value> where table A.column X=<some value> and table A.column Y in (select distinct table B.column Y from table B where table B.column A=<value> and table B.column B=<value> and table B.column C=<value> and table B.time_stamp between '<>' and '<>' and table B.column D in (some values));
update table B set table B.Column 2=<value>, table B.Column 3=sysdate where table B.column A=<value> and table B.column B=<value> and table B.column C=<value> and table B.time_stamp between '<>' and '<>' and table B.column D in (some values));
create table t1 ( x int, y int ); create table t2 ( x int, y int ); insert into t1 values (1, 1); insert into t2 values (2, 2); commit; select * from t1; X Y 1 1 update t1 set (x, y) = ( select x, y from t2 ); select * from t1; X Y 2 2
rollback; select * from t1; X Y 1 1 merge into t1 using t2 on (1=1) -- replace with your join clause when matched then update set t1.x = t2.x, t1.y = t2.y; select * from t1; X Y 2 2
The Oracle documentation contains a complete SQL reference.