Hi All..
I am new to MySQL database.....
So here i am having doubt in UPDATE ....
When using Oracle we can interchange rows from one column to another column. Example as follows:
I need query for the same in Mysql...
I am new to MySQL database.....
So here i am having doubt in UPDATE ....
When using Oracle we can interchange rows from one column to another column. Example as follows:
Code:
SQL> select * from sample;
ID SALARY
---------- ----------
1 10
2 20
3 30
4 40
SQL> update sample set id=salary, salary=id where id = id;
4 rows updated.
SQL> select * from sample;
ID SALARY
---------- ----------
10 1
20 2
30 3
40 4