substring_index(str,delim,count)
说明:substring_index(被截取字段,关键字,关键字出现的次数)
范例
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
-> 'www.mysql'
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
-> 'mysql.com'
substring_index(str,delim,count)
说明:substring_index(被截取字段,关键字,关键字出现的次数)
范例
相关文章: