The INSTR function in Oracle is to find the starting position of a substring in a string. The syntax is INSTR(string, substring, [start_position]). It returns the starting position of the matching substring. Find If not, return 0. Among them, string is the string to be searched, substring is the substring to be found, and start_position is the starting position of the search (optional). The INSTR function is not case-sensitive. By default, it searches from the beginning of the string. It supports searching from the specified position. If the substring appears multiple times in the string, only the starting position of the first matching item will be returned. If the string or subword
INSTR usage in Oracle
The INSTR function is used in Oracle to find substrings in a string. starting point. It returns the starting position of the matched substring, or 0 if no match is found.
Syntax:
<code>INSTR(string, substring, [start_position])</code>
Parameters:
Usage:
The INSTR function can be used to find whether another string exists in a string and return the starting position of the match. For example:
<code>SELECT INSTR('Hello World', 'World') FROM dual;</code>
Output:
<code>7</code>
This means that the substring "World" starts at the 7th character of the string "Hello World".
Optional parameters:
The start_position parameter allows you to specify a specific position in the string to start the search from. For example, to search starting at character 5:
<code>SELECT INSTR('Hello World', 'World', 5) FROM dual;</code>
Output:
<code>0</code>
This means that in the string "Hello World", there is no match starting at character 5.
Note:
The above is the detailed content of Instr usage in oracle. For more information, please follow other related articles on the PHP Chinese website!