MYSQL中批量替換某個字段的部分數據


1.修改字段里的所有含有指定字符串的文字

UPDATE 表A SET 字段B = replace(字段B, 'aaa', 'bbb')

    example: update  table set url= replace(url, 'aaa', 'bbb')  【將url字段中的aaa批量更改為bbb】

     update table  set url= REPLACE (url,'3','1.png')  where 條件;     

2.常規條件修改:

update table set column='' where column is null

列:update  `table` set `url`='0' where `url` is null


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM