简体   繁体   English

mysql从另一列复制数据

[英]mysql copy data from another column

I have 2 columns, ip_start, ip_start_long 我有2列,ip_start,ip_start_long

ip_start        |  ip_start_long
------------------------------------
0.255.255.255   |  16777215

I need to convert ip_start (INET_ATON) and copy update to ip_start_long for all rows (1 million rows) 我需要为所有行(100万行)转换ip_start (INET_ATON)并将更新复制到ip_start_long

How can I do it in php or phpmyadmin ? 我怎么能在phpphpmyadmin做到这一点?

简单的查询将为您完成此操作

update table set ip_start_long = INET_ATON(ip_start);

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM