(Contents)(Previous)(Next)

Searching the Position of Character Strings

A specified substring is to be searched in a character string; the function INDEX produces the position of the substring.

The character string where the search is to take place is specified as the first parameter of INDEX. The second parameter specifies the substring to be searched. In an optional third parameter, the start position for the search can be specified; in an optional fourth parameter, the occurrence of the substring to be searched can be specified.

In the following example, the position of the character string 'ow' is to be determined in all customer names.

SELECT name, INDEX(name, 'ow') position_ow

FROM customer


(Contents)(Previous)(Next)