SQL: charindex ('string', field)> 0 charindex ('admin', MUserID)> 0
Oracle: instr (field, 'string',)> 0 instr (MUserID, 'admin',)> 0
The Instr function in Oracle is used in the project. By the way, I learned this knowledge carefully.
In Oracle, you can use the Instr function to determine whether a string contains specified characters.
Its syntax is:
Instr (string, substring, position, occurrence)
Where
String: indicates the source string;
Substring: represents the substring to be searched in the intelligent source string;
Position: indicates the start position of the search. this parameter is optional. The default value is 1;
Occurrence: specifies the number of substrings that appear from the source character list. This parameter is optional. The default value is 1;
If the position value is negative, it indicates searching from right to left.
Return Value: the position of the searched string.
For Instr functions, we often use this method to find the position of the specified substring from a string.
For example:
SELECT Instr ('Hello word', 'O',-1, 1) "String" FROM Dual:
Instring
----
8