【mysql】mysql的SUBSTRING_INDEX
2013-06-19 13:09
204 查看
SUBSTRING_INDEX(str,delim,count)
Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter
(counting from the right) is returned. SUBSTRING_INDEX() performs a case-sensitive match when searching for delim.
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
-> 'www.mysql'
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
-> 'mysql.com'
This function is multi-byte safe.
Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter
(counting from the right) is returned. SUBSTRING_INDEX() performs a case-sensitive match when searching for delim.
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
-> 'www.mysql'
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
-> 'mysql.com'
This function is multi-byte safe.
相关文章推荐
- [置顶] 【mysql 字符串截取】SUBSTRING_INDEX用法
- MySQL种字符串拆分(substring_index)并作为关联查询条件后多列展示
- mysql处理字符串的两个绝招:substring_index,concat
- Mysql字符串截取总结:left()、right()、substring()、substring_index()
- mysql字符截取substring_index
- 【SUBSTRING_INDEX】MySQL官方示例
- MySQL种字符串拆分(substring_index)并作为关联查询条件后多列展示
- mysql截取字符串substring_index(str,delim,count)
- mysql处理字符串的两个绝招:substring_index,concat
- Mysql SUBSTRING_INDEX起split函数作用
- mysql GROUP_CONCAT+ GROUP BY + substring_index获取分组的前几名
- MySQL种字符串拆分(substring_index)并作为关联查询条件后多列展示
- mysql处理字符串的两个绝招:substring_index,concat
- mysql中字符串的截取函数SUBSTRING_INDEX
- mysql的SUBSTRING_INDEX 的使用
- mysql的 函数 group_concat , substring_index 的使用以及 分库分表操作
- MySQL种字符串拆分(substring_index)并作为关联查询条件后多列展示
- mysql中对order by的函数substring_index() , find_in_set()使用
- mysql处理字符串的两个绝招:substring_index,concat
- 【MySQL】字符串截取之substring_index