Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Update

$
0
0
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:

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

I need query for the same in Mysql...

Viewing all articles
Browse latest Browse all 13329

Trending Articles