mysql替換字符串
作者:佚名 時(shí)間:2012-11-25 分享到:
mysql中replace函數(shù)直接替換mysql數(shù)據(jù)庫(kù)中某字段中的特定字符串,不再需要自己寫(xiě)函數(shù)去替換,用起來(lái)非常的方便。 mysql 替換函數(shù)replace()
UPDATE `table_name` SET `field_name` = replace (`field_name`,'from_str','to_str') WHERE `field_name` LIKE '%from_str%'
說(shuō)明:
table_name —— 表的名字
field_name —— 字段名
from_str —— 需要替換的字符串
to_str —— 替換成的字符串
如沒(méi)特殊注明,文章均為上海聯(lián)楷網(wǎng)絡(luò)原創(chuàng),轉(zhuǎn)載請(qǐng)注明來(lái)自:http://www.ktcbnqb.cn/contact/20151229/n7368.html