Skip to content

Returns a substring from a string before or after a specified number of delimiter occurrences.

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