Skip to content

Returns the position of the first occurrence of a substring in a string.

func.locate(<substr>, <str>[, <pos>])
func.locate('or', 'hello world')
┌───┐
8
└───┘
LOCATE(<substr>, <str>[, <pos>])
SELECT LOCATE('or', 'hello world');
┌───┐
8
└───┘