Update with Join query in Oracle

后端 未结 2 712

what is wrong in query? (it executes indefinitely)

UPDATE table1 t1 SET (t1.col,t1.Output) = (
  SELECT t2.col, t3.Output + t2.col
  FROM tabl2 t3 
  LEFT JO         


        
2条回答
  •  清歌不尽
    2020-11-29 14:48

    Your query does not make a whole lot of sense with the generic table1, table2, and join_key references.

    If this is not what you are looking for, it would be helpful to have some sample data to get a better idea of what results you are looking for.

    update table1 t1
       set t1.col = (select t2.col
                     from table2 t2
                     where  t1.join_key = t2.join_key(+)  
                      and  t1.col is not null),
           t1.output = (select t2.output + t1.col
                        from  table2 t2
                       where  t1.join_key = t2.join_key(+)  
                         and  t1.col is not null);
    

提交回复
热议问题