The use of instr function in oracle

 

The format of the INSTR method is
INSTR(source string, string to find, starting from the first character (the default is 1), the number of the matching number to be found (the default is 1))
and returns the found position. If not, return 0.
For example: INSTR('CORPORATE FLOOR','OR', 3, 2), the source string is 'CORPORATE FLOOR', find 'OR' in the string, starting from the third character position Look for "OR" and take the position of the 2nd match after the 3rd word.

 

The default search order is left to right. When the starting position is negative, the search starts from the right.

 

So the result of SELECT INSTR('CORPORATE FLOOR', 'OR', -1, 1) "aaa" FROM DUAL is

 

Instring
——————
14

 

Why is 14 instead of 13, because the first position in oracle is 1 instead of 0 in java

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325339663&siteId=291194637