Search code examples
mysqldatabase-administration

how to copy one column to another with data in mysql on same table?


I have a user_master table. And i have need to copy user's first address to alternate address column for all users those alternate address is not available.


Solution

  • Just use update table query. Kindly check below.

    UPDATE users_master SET alt_address = first_address WHERE alt_address = '';