《MYSQL數(shù)據(jù)庫(kù)mysql trim函數(shù)用法舉例》要點(diǎn):
本文介紹了MYSQL數(shù)據(jù)庫(kù)mysql trim函數(shù)用法舉例,希望對(duì)您有用。如果有疑問(wèn),可以聯(lián)系我們。
mysql中去除左空格函數(shù):
?MYSQL入門(mén)
例子:
?MYSQL入門(mén)
mysql中去除右空格函數(shù):
?MYSQL入門(mén)
例3:
?MYSQL入門(mén)
this function is multi-byte safe.MYSQL入門(mén)
trim函數(shù)可以過(guò)濾指定的字符串:
完整格式:trim([{both | leading | trailing} [remstr] from] str)
簡(jiǎn)化格式:trim([remstr from] str)MYSQL入門(mén)
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入門(mén)
mysql trim函數(shù)的例子:
?MYSQL入門(mén)
mysql> select trim(' bar?? '); //默認(rèn)刪除前后空格
-> 'bar'
mysql> select trim(leading ',' from ',,barxxx'); //刪除指定首字符 如’,‘
-> 'barxxx'
mysql> select trim(both ',' from ',,bar,,,');? //刪除指定首尾字符
-> 'bar'
mysql> select trim(trailing ',' from 'barxxyz,,');
-> 'barxxyz'MYSQL入門(mén)
mysql> update table set `field`=trim(trailing ',' from `field`) where where `field` like '%,';
this function is multi-byte safe.MYSQL入門(mén)
維易PHP培訓(xùn)學(xué)院每天發(fā)布《MYSQL數(shù)據(jù)庫(kù)mysql trim函數(shù)用法舉例》等實(shí)戰(zhàn)技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培養(yǎng)人才。
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/7410.html