mysql
replace(str,from_str,to_str)
在字符串 str 中所有出现的字符串 from_str 均被to_str替换,然后返回这个字符串
例如:
update wp_posts set guid=replace(guid,’before_string’,'after_string’);

replace into
replace into table (id,name) values('1','aa'),('2','bb')
此语句的作用是向表table中插入两条记录。如果主键id为1或2不存在
就相当于
insert into table (id,name) values('1','aa'),('2','bb')
如果存在相同的值则不会插入数据

replace(object,search,replace)
把object中出现search的全部替换为replace
例如:
select replace('test','t','x')--->xesx

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code