《MySQL 內置字符串函數》要點:
本文介紹了MySQL 內置字符串函數,希望對您有用。如果有疑問,可以聯系我們。
concat()
用于連接字段
LTRIM() , RTRIM(), TRIM()
分別用于去除左邊空格,右邊空格,以及左右空格都去除
NOW()
放回當前的日期和時間
UPPER() 和LOWER()
upper():轉換為年夜寫輸出; lower() 轉換為小寫輸出
LEFT()
返回串左邊的字符
RIGHT()
返回串右邊的字符,辦法參考LEFT()
LOCATE
用法: LOCATE(substr, str) or LOCATE(substr, str, position),substr在str中存在返回第一次找到的地位,從1開始, 沒有則返回0;
substring()
用法: substring(str, position) 或者 substring(str, position, length) ,若position為負數則從后面開始數.
返回字符串str中從position起,length個字符長度的字符串.
position()
返回子串substr在字符串str第一個呈現的位置,如果substr不是在str里面,返回0.
replace()
replace(str, sear_str, sub_str) ,將字符串str中所有呈現的sear_str字符串替換為sub_str
insert(str, position, length, insert_str)
將str的從position地位開始的length個字符替換為insert_str
維易PHP培訓學院每天發布《MySQL 內置字符串函數》等實戰技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培養人才。
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/7889.html