在 OceanBase 数据库中,INSTR 函数用于查找一个字符串在另一个字符串中的位置。其基本语法如下:
INSTR(source_string, search_string, start_position, occurrence)

其中:

  •  source_string 是要搜索的原始字符串。

  •  search_string 是要查找的子串。

  •  start_position 是可选的参数,指定开始搜索的位置,默认为 1。

  •  occurrence 是可选的参数,指定要返回的匹配项的序号,默认为 1。


以下是一个例子:
SELECT INSTR('Hello, World!', 'World') AS result;

这将返回结果: