Home > Database > Mysql Tutorial > body text

Mysql去除数据中的空格sql语句_MySQL

WBOY
Release: 2016-06-01 13:36:39
Original
870 people have browsed it

bitsCN.com


Mysql去除数据中的空格sql语句

 

在录数据时发现有些字典表中值后面有多余的空格,一下sql语句可以批量去掉 

Java代码  

update location set LOCATION_CODE = trim(LOCATION_CODE)   

 

同理也可以使用REPLACE函数批量替换,下例为批量替换换行为空格 

 

Java代码  

update location set LOCATION_CODE  = replace(LOCATION_NAME, '/r/n', ' ');  

 

bitsCN.com
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