update 追加一个字段的内容,或替换一个字段里面某些字符

一:

使用REPLACE更新某表中某个字段详细内容

update `表名` set 字段名 =replace(字段名, '查找的内容','更改的内容') where 字段名 like '%查找的内容%';

update shangpin set click_url=replace(click_url,'21508360','1111111111') where click_url like '%21508360%';

二:

mysql concat追加字符串后追加update表名set字段名=concat(字段名,"str

mysql concat追加字符串  

1.后追加update 表名 set 字段名 = concat(字段名,"string")    
2.前追加update 表名 set 字段名 = concat("string",字段名) 

UPDATE  log_201408_35  SET `return_content`=CONCAT (`return_content`,' world') WHERE id=1

猜你喜欢

转载自blog.csdn.net/ding_xc/article/details/81667696