Copy values from one column to another in the same table

前端 未结 7 1652
别那么骄傲
别那么骄傲 2020-12-02 05:08

How can I make a copy values from one column to another? I have:

Database name: list
number | test
123456 | somedata
123486 | somedata1
232344 | 34
         


        
7条回答
  •  抹茶落季
    2020-12-02 05:35

    Following worked for me..

    1. Ensure you are not using Safe-mode in your query editor application. If you are, disable it!
    2. Then run following sql command

    for a table say, 'test_update_cmd', source value column col2, target value column col1 and condition column col3: -

    UPDATE  test_update_cmd SET col1=col2 WHERE col3='value';
    

    Good Luck!

提交回复
热议问题