INSTR(str,substr)
Returns the position of the first occurrence of substring substr in string str. This is the same as the two-argument form of LOCATE(), except that the order of the arguments is reversed.
INSTR()
performs a case-insensitive search.
If any argument is NULL
, returns NULL
.
SELECT INSTR('foobarbar', 'bar'); +---------------------------+ | INSTR('foobarbar', 'bar') | +---------------------------+ | 4 | +---------------------------+ SELECT INSTR('My', 'Maria'); +----------------------+ | INSTR('My', 'Maria') | +----------------------+ | 0 | +----------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/instr/