LOCATE(substr,string[,position])

Description: Without position, returns the character position of the first occurrence of substr within string, or 0 if it does not occur.

With position, returns the first occurrence of substr at or after that number of characters from the start of string.

Examples:

  • LOCATE('a','Harold Jacobs') returns 2.

  • LOCATE('JACOBS','Harold Jacobs') returns 8.

  • LOCATE(BINARY 'JACOBS','Harold Jacobs') returns 0.

  • LOCATE('a','Harold Jacobs',6) returns 9.

See also: INSTR(), POSITION()

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.48.181