INSTR(str,substr): Returns the position of the first occurrence of substring substr in string str : INSTR « String Functions « MySQL Tutorial






mysql>
mysql> SELECT INSTR('ABCDE', 'AB');
+----------------------+
| INSTR('ABCDE', 'AB') |
+----------------------+
|                    1 |
+----------------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT INSTR('ABC', 'DEF');
+---------------------+
| INSTR('ABC', 'DEF') |
+---------------------+
|                   0 |
+---------------------+
1 row in set (0.00 sec)

mysql>








23.17.INSTR
23.17.1.INSTR(str,substr): Returns the position of the first occurrence of substring substr in string str
23.17.2.Returning the position of J in first name