콘텐츠로 이동

구분자가 지정한 횟수만큼 나타나기 전 또는 후의 부분 문자열을 반환합니다.

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 │
└─────────────┘