简体   繁体   English

如何在同一表上的mysql中将数据复制到另一列?

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

I have a user_master table. 我有一个user_master表。 And i have need to copy user's first address to alternate address column for all users those alternate address is not available. 对于所有那些备用地址不可用的用户,我需要将用户的第一个地址复制到备用地址列。

Just use update table query. 只需使用更新表查询即可。 Kindly check below. 请在下面检查。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从一个表数据复制列到另一表并在mysql中同时插入更多列? - how to copy column from one table data to another table and insert more columns same time in mysql? MySql中如何将列数据从一张表复制到另一张表? - How to Copy Column data from one table to another table in MySql? MYSQL-将一列复制到同一表中的另一列-有条件 - MYSQL - copy one column to another in the same table - with conditions 无法在MySQL中将列数据从一个表复制到另一个表 - Unable to copy column data from one table to another in MySQL mysql列数据通过联接从一个表复制到另一个表? - mysql column data copy from one table to another with a join? MySQL如何从一列中获取数据并以相同的ID和相同的表放入另一列 - MySQL how to take data from one column and put to another column under same ID and same table 如何将数据从表复制到仅具有同一列的另一个表 - How to copy data from table to another table with the same column only 如何将数据从一个表复制到 MySQL 中的另一个新表? - How to copy data from one table to another new table in MySQL? 如何将一个表数据复制到另一个表,其中包含 2 个 wherecondtion 和一个 if 条件 MYSQL - How to Copy one table data to another table with 2 wherecondtion and an if condtion MYSQL 将一列复制到另一张表中的mysql - Copy one column to another in different table mysql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM