问一下mysql中怎么把全部列的null值替换为0

MySql 码拜 8年前 (2016-05-01) 2112次浏览
是全部列全部列全部列哦
解决方案

10

生成脚本并执行呗
mysql -e “select concat(“update “, table_schema, “.”, table_name, ” set “, column_name, ” = 0 where “, column_name, ” is null;”) from information_schema.columns where 条件;” > xx.sql
mysql < xx.sql

10

按照楼上的方法 加个where条件 要不把系统表都给更新了

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明问一下mysql中怎么把全部列的null值替换为0
喜欢 (0)
[1034331897@qq.com]
分享 (0)