Update Statement in ORacle based on data in another 2 tables -
i need update 1 master table based on join 2 tables. anyoe please provide me best approach here need update millions of records using update.
maybe example useful:
create table a( id int, str varchar2(10)); create table b( id int, str varchar2(10)); insert values(1,'a1'); insert values(2,'a2'); insert values(3,'a3'); insert b values(1,'b'); insert b values(3,'c'); insert b values(4,'d'); /*here query!!*/ merge using ( select id, str b ) b on ( a.id = b.id ) when matched update set a.str = b.str;
here other query, maybe have problems null values (try here):
update set str = ( select str b a.id = b.id);
you can try here
Comments
Post a Comment