INSTR
Return the position of the first occurrence of a substring. This function locates a substring within a string and returns its index.
Syntax
INSTR(str,substr)Description
Examples
SELECT INSTR('foobarbar', 'bar');
+---------------------------+
| INSTR('foobarbar', 'bar') |
+---------------------------+
| 4 |
+---------------------------+
SELECT INSTR('My', 'Maria');
+----------------------+
| INSTR('My', 'Maria') |
+----------------------+
| 0 |
+----------------------+See Also
Last updated
Was this helpful?

