![]() |
mysql清除数据库中字符串空格方法
在mysql清除字符串空格有两个常用的使用方法一种是利用trim函数另一种是直接replace字符替换函数进行清除,下面我来给大家详细介绍。
(1)mysql replace 函数 语法:replace(object,search,replace) 意思:把object中出现search的全部替换为replace 案例: Code:
update `news` set `content`=replace(`content`,' ','');(2)mysql trim 函数 完整格式:TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str) 简化格式:TRIM([remstr FROM] str) 以下举例说明: Code:
1 mysql> SELECT TRIM(' phpernote '); Code:
LTRIM(str) Code:
mysql> SELECT LTRIM(' barbar'); |
| All times are GMT +8. The time now is 01:14 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.