mysql 批量update更新数据

#!/bin/sh
 
mysqlconn="mysql -uroot"
db="dbname"
table1="tablename"

while($mysqlconn -N -e "select item_id from $db.$table1 where  matching_status = 0 limit 1;")
do
   #echo 1
   $mysqlconn -e  "update $db.$table1 set  matching_status = 1, matching_fail_reason = null, pim_flag = 0 where matching_status = 0 limit 10000"

done  
发布了193 篇原创文章 · 获赞 30 · 访问量 49万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章