REPLACE 更新替換數據庫某個字段的的部分的值,比如替換數據庫中url字段的域名,
語法:REPLACE ( ''cloum'' , ''string_old'' , ''string_old'' )
參數
''cloum''
待替換字段的字符串表達式。
''string_old''
待查找的字符串表達式。
''string_old''
替換用的字符串表達式。
示列:將表 table_name中url字段里的'http://www.baidu.com替換成http:/www.google.com
UPDATE table_name set URL=replace(URL,'http://www.baidu.com','http:/www.google.com') where 1=1;
