MySQL数据库使用replace方法去除字段中的换行符/回车/空格

/ 1评 / 0

wordpress 去除换行符,空格等

去换行符

update wp_posts set post_content = replace(post_content, char(13), '');

去回车符

update wp_posts set post_content = replace(post_content, char(10), '');

去空格符

update wp_posts set post_content = replace(post_content, char(13), '');

一起去掉换行符/回车/空格

update wp_posts set post_content = replace(replace(replace(post_content , char(10), ''),char(13), ''), char(9), '');
  1. 啥也不说了,就是给力!

发表评论