跳转到内容

返回字符串中指定数量的分隔符出现之前或之后的子字符串。

func.substring_index(<str>, <delim>, <count>)
func.substring_index('www.example.com', '.', 2)
┌───────────────┐
│ 'www.example' │
└───────────────┘
SUBSTRING_INDEX(<str>, <delim>, <count>)
SELECT SUBSTRING_INDEX('www.example.com', '.', 2);
┌─────────────┐
│ www.example │
└─────────────┘