7 Replies Latest reply: Feb 1, 2013 11:07 AM by Nicosa-Oracle RSS

    How to use the updated value in the same update statement


      I just wonder how to use the updated new value of other column in the same udpate statement. I am using Oracle 11.2, and want to update the two columns with one update statement as following:

      create table tb_test (id number(5), tot number(5), mon_tot number(5));

      update tb_test set (tot = 15, mon_tot = tot *15) where id = 1;

      ...I would like to update both tot and mon_tot column, the value of mon_tot shall be determinted by the new value of tot.


      Edited by: 939569 on 1-Feb-2013 7:00 AM