Friday, 15 May 2015

change the value of one row with another row in same table using sql -



change the value of one row with another row in same table using sql -

i have table .

code | name -------+--------------- 102 | chennai 101 | delhi

i want alter code of chennai 101 , delhi 102. how can this?

update table1 set code = 103 code = 102; update table1 set code = 102 code = 101; update table1 set code = 101 code = 103;

or can utilize cursor

sql

No comments:

Post a Comment