PL / SQL in InStr () function (returns the character position)

InStr Format () function

I.: instr (string1, string2) // instr (the source string, the target string)

Case 2: instr (string1, string2 [, start_position [, nth_appearance]]) // instr (the source string, the target string, the starting position, matching serial number)

Analysis: To find the value of string2 in string1, from the values given start_position (ie: position) in the retrieval string1, string2 found in the corresponding position number)
Formats:

SELECT INSTR('HARRY JAY','A')FROM DUAL --第一次出现A的位置

A screenshot:
Here Insert Picture Description
Format two

SELECT INSTR('HARRY JAY','A',2,2)FROM DUAL --从第二位开始,第二个A
                                           -- 位置 

Screenshot two
Here Insert Picture Description

Reference: https: //www.cnblogs.com/dshore123/p/7813230.html

Published 153 original articles · won praise 15 · Views 150,000 +

Guess you like

Origin blog.csdn.net/beyond911/article/details/103431968