将comment表中的author_url包含www.sohu.com的记录,其中的sohu替换为sina,一个语句搞定~
update comment set author_url=replace(author_url,'sohu','sina') where author_url regexp 'www.sohu.com';
带if判断的复杂替换
update comment set url=if(url regexp 'test.yahoo.com.cn',replace(url,'www1.sohu.com','www.sina.com'),replace(url,'www2.yahoo.com','www.sina.com')) where 1=1;
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!
网友评论