insert是插入语句,update是修改,replace是替换。
用法例:insert into 表 value(字段名1,字段名2)
update 表名 set name=xiaoming where name=xiaoqiang. 这样名字就被改了
UPDATE tb1 SET f1=REPLACE(f1, 'abc', 'def');
REPLACE(str,from_str,to_str)
在字符串 str 中所有出现的字符串 from_str 均被 to_str替换,然后返回这个字符串
这个函数用来批量替换数据中的非法关键字是很有用的!如下例子:
例1:UPDATE BBSTopic SET tcontents = replace(replace(tcontents,'共产党','') ,'找死','') where tcontents like '%共产党%' or tcontents like '%找死%'
例2:UPDATE typetable SET type_description=REPLACE(type_description,'360','
http://www.jb51.net');
记得给分啊!!!