Home > Database > Mysql Tutorial > 替换字段中有回车/换行的SQL

替换字段中有回车/换行的SQL

WBOY
Release: 2016-06-07 14:54:53
Original
1561 people have browsed it

取消或替换回车/换行,保持数据清洁 无 --替换回车UPDATE table_nameSET field_name=REPLACE(field_name,CHR(13),'')WHERE INSTR(field_name,CHR(13))0 --替换换行UPDATE table_nameSET field_name=REPLACE(field_name,CHR(10),'')WHERE INSTR(field_name,CHR(

取消或替换回车/换行,保持数据清洁
--替换回车
UPDATE table_name
SET field_name=REPLACE(field_name,CHR(13),'')
WHERE INSTR(field_name,CHR(13))>0 
--替换换行
UPDATE table_name
SET field_name=REPLACE(field_name,CHR(10),'')
WHERE INSTR(field_name,CHR(10))>0 

table_name:表名
field_name:列名
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template