instr

Description

Syntax

‘INT INSR (WARCHAR STR, WARCHAR substrate)’

Returns the location where substr first appeared in str (counting from 1). If substr does not appear in str, return 0.

example

  1. mysql> select instr("abc", "b");
  2. +-------------------+
  3. | instr('abc', 'b') |
  4. +-------------------+
  5. | 2 |
  6. +-------------------+
  7. mysql> select instr("abc", "d");
  8. +-------------------+
  9. | instr('abc', 'd') |
  10. +-------------------+
  11. | 0 |
  12. +-------------------+

keyword INSTR