Mega Code Archive

 
Categories / MySQL / String
 

INSTR(string, substring) identifies where the substring is located in the string and returns the position

number. mysql> mysql> mysql> SELECT INSTR('cats and dogs', 'dogs'); +--------------------------------+ | INSTR('cats and dogs', 'dogs') | +--------------------------------+ |                             10 | +--------------------------------+ 1 row in set (0.00 sec) mysql>