Mega Code Archive

 
Categories / MySQL / String
 

LOCATE(substring, string, position)

mysql> mysql> SELECT LOCATE('dogs', 'cats and dogs and more dogs', 15); +---------------------------------------------------+ | LOCATE('dogs', 'cats and dogs and more dogs', 15) | +---------------------------------------------------+ |                                                24 | +---------------------------------------------------+ 1 row in set (0.00 sec)