Similar to indexof in oracle, The _ instr function [SQL] does not have the indexof () function in oracle, but an instr () method is provided. Specific usage: select instr ('baoding nanchengqu ', 'city',)-1 from dual; Explanation: 1. 'baoding city South' => it can be an expression or a specific data. 'city' => is the separator. Here is the word "city" in the two g
Instr (title, 'manual')> 0 is equivalent to title like '% manual %'
Instr (title, 'manual') = 1 is equivalent to title like 'manual' %'
Instr (title, 'manual') = 0 is equivalent to title not like '% manual %'
Special usage:
Select ID, name from users where instr ('1970 3', ID)> 0;It is equivalentSelect ID, name from u
Oracle title like% keyword% InStr (title, ' keyword ') difference
Page wrote a search, I want to optimize the acceleration query, search the next found there is a InStr (title, ' keyword ')InStr (title, ' keyword ') >0 equivalent to the title like '% keyword% '
InStr (title, ' keyword ') = 0 equivalent to title not l
In OracleYou can use the InStr function to judge a string to determine whether it contains the specified character.Finds the specified character in a string, returning the position of the specified character that was found.Grammar:InStr (Sourcestring,deststring,start,appearposition)InStr (' Source string ', ' target string ', ' Start position ', ' first occurrence ')Where sourcestring represents the source
In OracleYou can use the InStr function to judge a string to determine whether it contains the specified character.Finds the specified character in a string, returning the position of the specified character that was found.Grammar:InStr (Sourcestring,deststring,start,appearposition)InStr (' Source string ', ' target string ', ' Start position ', ' first occurrence ')Where sourcestring represents the source
No indexof () function in OracleHowever, an instr () method is provided for specific usage:Select instr ('South city of Baoding City ', 'city', 1, 1)-1 from dual;Explanation: 1. 'baoding City South region' => it can be an expression or a specific data2. 'city' => is the separator. Here is the word "city" in the two groups of data.3. The first 1 starts from the left. If it is-1, it starts from the right.4. T
SQL: charindex ('string', field)> 0 charindex ('admin', MUserID)> 0Oracle: instr (field, 'string',)> 0 instr (MUserID, 'admin',)> 0The 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 specifie
There is no indexof () function in Oracle
but provides a InStr () method specific use:
Select InStr (' Baoding Nanshi District ', ' City ', 1,1)-1 from dual;
Explanation: 1. The ' Baoding Nanshi District ' => can be an expression, or it can be a specific data of
2. ' City ' => is the symbol of separation, here is the word "city" in two sets of data
3. The first 1 starts from the left and
Oracle is used in the projectInstrThis function, by the way, carefully learns this knowledge again.
In Oracle, you can useInstrThe function determines 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;
Tags: style io ar os sp strong on Art sizeSyntax:InStr (Fatherstr, Sonstr [, Start_position [, Matchtimes]])Fatherstr: The parent string where to find the substring in this string.SONSTR: The string to find in Fatherstr.Start_position: Represents the starting position of the search from fatherstr . This parameter is optional if omitted by default to 1.The string index starts at 1. If this parameter is positive, the search starts from left to right, if this parameter is negative, right-to-left,Re
Syntax:InStr (Fatherstr, Sonstr [, Start_position [, Matchtimes]])FATHERSTR: Parent String. The position of the substring to look for in this string.SONSTR: The string to find in Fatherstr.Start_position: Represents the starting position from which the Fatherstr was started. This can be optional, assuming that the omission of the default is 1.The string index starts at 1. Assume that the parameter is positive. Start from left to right. Assuming this is a negative, right-to-left search,Returns th
The difference between Oracle like and InStrInStr does not belong to a fuzzy query.From the standpoint of efficiency:Who can use the index, whose query speed will be fast.Like sometimes you can use the index, for example: Name "Lee%"The index is invalidated when the following conditions occur: name like '% Lee 'Unlike other databases, Oracle supports functional indexing. For example, build a InStr index on the name field. The query speed is relatively
Grammar
The code is as follows
Copy Code
InStr (string1, string2 [, Start_position [, Nth_appearance]])
String1 is the string to search for.
string2 searches for substrings in string1.
Start_position is where the search will begin in string1. This parameter is optional. If omitted, the default is 1. The first position in the string is 1. If the start_position is a negative number, the function searches for the
Http://www.jb51.net/article/42369.htmSql:charindex (' String ', field) >0 charindex (' Administrator ', Muserid) >0Oracle:instr (field, ' String ', >0) InStr (Muserid, ' Administrator ', ") >0In the project, we used the function of INSTR in Oracle, and learned this knowledge again and again carefully.In Oracle, you can use the INSTR function to judge a string to
Select substr (memo, (instr (memo, ':',-1,1) + 1) from sfa_order_item where trunc (gmt_modified) = trunc (sysdate)
I personally understand some simple subtr usage
Substr ('field name', 3) Here it means to extract this field from the third digit until the end. Of course, if the following number is the same as the length of this field, it is null.
Some simple instr usage
(
The key to implementing the search function is to use the instr function, which can locate the first position of the specified string in another string. Let's take a look at the syntax for using this function:
Instr ([start,] string1, string2 [, compare])
The parameters required for this function are the starting position, the subject string, and the string to be searched. Compare is an optional parameter.
One: Theory
Oracle Intercept character (SUBSTR), retrieving character position (instr) case when then else End statement uses favoritesCommon functions: Substr and InStr1.SUBSTR (String,start_position,[length]) to substring, return stringExplanation: String Meta stringStart_position starting position (starting from 0)Length optional, number of substringsFor example:
substr ("ABCDEFG", 0); Back: ABCDEFG, intercept all characters
substr ("ABCDE
INSTR (STR,SUBSTR)Returns the first occurrence of a string of str neutron strings. This is the same as locate (), unless the order of the parameters is reversed.
The code is as follows
Copy Code
mysql> SELECT INSTR (' Foobarbar ', ' Bar ');-> 4mysql> SELECT INSTR (' Xbar ', ' foobar ');-> 0
LOCATE (SUBSTR,STR), LOCATE (Subst
Label: Transferred from: http://knowyouknowme.iteye.com/blog/554945 1.instr In Oracle/plsql, theInStr function returns the position of the string to intercept in the source string. The syntax is as follows: InStr (string1, string2 [, Start_position [, Nth_appearance]]) string1 The source string to find in this string. string2 The string to find in the string1 . start_position represents where string1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.