《MYSQL数据库mysql trim函数用法举例》要点:
本文介绍了MYSQL数据库mysql trim函数用法举例,希望对您有用。如果有疑问,可以联系我们。
mysql中去除左空格函数:
MYSQL入门
例子:
MYSQL入门
mysql中去除右空格函数:
MYSQL入门
例3:
MYSQL入门
this function is multi-byte safe.MYSQL入门
trim函数可以过滤指定的字符串:
完整格式:trim([{both | leading | trailing} [remstr] from] str)
简化格式:trim([remstr from] str)MYSQL入门
returns the string str with all remstr prefixes or suffixes removed. if none of the specifiers both, leading, or trailing is given, both is assumed. remstr is optional and, if not specified, spaces are removed.MYSQL入门
mysql trim函数的例子:
MYSQL入门
mysql> select trim(' bar '); //默认删除前后空格
-> 'bar'
mysql> select trim(leading ',' from ',,barxxx'); //删除指定首字符 如’,‘
-> 'barxxx'
mysql> select trim(both ',' from ',,bar,,,'); //删除指定首尾字符
-> 'bar'
mysql> select trim(trailing ',' from 'barxxyz,,');
-> 'barxxyz'MYSQL入门
mysql> update table set `field`=trim(trailing ',' from `field`) where where `field` like '%,';
this function is multi-byte safe.MYSQL入门
维易PHP培训学院每天发布《MYSQL数据库mysql trim函数用法举例》等实战技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培养人才。
转载请注明本页网址:
http://www.vephp.com/jiaocheng/7410.html