mysql数据库中替换回车换行符

xiaoxiao2021-02-28  133

update resource SET html_code = REPLACE(REPLACE(html_code, CHAR(10), ''), CHAR(13), ''), `name` = REPLACE(REPLACE(name, CHAR(10), ''), CHAR(13), '') where id = 6256;

 

char(9)   水平制表符  char(10) 换行  char(13) 回车

 

在不同环境通用的查询含有回车换行sql

 

select code ,name from resource where html_code like ('%'+CHAR(10) + '%' ) or html_code like ('%'+CHAR(13)+CHAR(10) + '%') or html_code like ('%'+CHAR(13)+ '%');

 

 

 

 

 

转载请注明原文地址: https://www.6miu.com/read-34403.html

最新回复(0)