Code:SQL> SQL> create table boring_test 2 (emp_id number, 3 name varchar2(20)) 4 ; Table created. SQL> insert into boring_test values(102, 'sam'); 1 row created. SQL> insert into boring_test values(103, 'raj'); 1 row created. SQL> commit; Commit complete. SQL> select * 2 from boring_test; EMP_ID NAME ---------- -------------------- 102 sam 103 raj SQL> SQL> update boring_test 2 set name = decode(name, 'sam','raj','raj','sam',name) 3 ; 2 rows updated. SQL> commit; Commit complete. SQL> select * 2 from boring_test; EMP_ID NAME ---------- -------------------- 102 raj 103 sam SQL>




Reply With Quote