The format of the INSTR method is INSTR (source string, target string, start position, matching serial number), for example: INSTR (
The format of the INSTR method is INSTR (source string, target string, start position, matching serial number), for example: INSTR (
The format of the INSTR method is
INSTR (source string, target string, start position, matching serial number)
For example, in INSTR ('upgrade FLOOR ', 'or', 3, 2), the source string is 'upgrade FLOOR', the target string is 'or', And the start position is 3, take the location of 2nd matching items.
The default search order is left to right. When the start position is negative, search from the right.
Therefore, the result of select instr ('upgrade FLOOR ',' OR ',-1, 1) "Instring" from dual is:
Instring
------
14
Oracle substr function usage
Obtain the string substr (string, start_position, [length]) with the specified start position and length in the string.
For example:
Substr ('this is a test', 6, 2) wowould return 'is'
Substr ('this is a test', 6) wocould return 'is a Test'
Substr ('techonthenet ',-3, 3) wocould return 'net'
Substr ('techonthenet ',-6, 3) wocould return The 'select substr ('thisatest',-4, 2) value from dual