You can use the InStr function to judge a string to determine whether it contains the specified character.
Its syntax is:
InStr (Sourcestring,deststring,start,appearposition). InStr (' Source string ', ' target string ', ' Start position ', ' first
Source: Tianji BLOG
I have been learning asp for some time. I have been writing my own program for the past few days and have encountered many problems. I have to consider some of the current vulnerabilities, for example, 'or and 1 = 1 and so on!
Brief description today when writing SQL, the ID in table A is stored according to the tree structure. Now it is necessary to connect with the node_id in table B and take out the information that node_id in B can connect to the node_id of any level
An example of the character location (instr) retrieved by the oracle character truncation (substr) is as follows: substrinstr
I. Theory
Oracle truncation character (substr), search character location (instr) case when then else end statement use
InStr function
Returns the position of the first occurrence of a string in another string.
InStr([start, ]string1, string2[, compare])
Parameters
Start
Options available. A numeric expression that sets the starting position for each search. If
The first thing that comes to mind is contains,contains usage as follows:
SELECT * from students where contains (address, ' Beijing ')
However, using the CONTAINS predicate has the condition that the column is indexed, that is, if the
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 [,
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
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 ('
Implement IndexOf and LastIndexOf features in Oracle SQL, substr and InStr Usage Blog Category: Oraclepl/sql instrsubstrlastindexofindexoforacle. Implementing IndexOf and LASTINDEXOF capabilities in Oracle SQL Oracle, SQL, INDEXOF, lastIndexOf today,
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.