Oracle SQL :Updating multiple columns with single query
update emp
set (sal, comm) = ( select fld3, fld4 from emp_app where fld1 = 3)
where comm is null;
update emp
set sal = 1000,comm = (select comm from emp_app where fld1 = 5),
fld4 = (select fld4 from emp_app where fld1 = 5);
update emp
set (sal, comm) = ( select fld3, fld4 from emp_app where fld1 = 3)
where comm is null;
update emp
set sal = 1000,comm = (select comm from emp_app where fld1 = 5),
fld4 = (select fld4 from emp_app where fld1 = 5);