--substr (string, intercept start position, intercept length) = return the intercepted wordSelectSubstr'miaoying',0,1) fromDual--The returned result is: MSelectSubstr'miaoying',1,1) fromDual--The returned result is: m--description 0 and 1 both indicate that the intercept position is the first characterSelectSubstr'miaoying',-7,4) fromDual--The returned result is: iaoy--negative indicates that: 7 means starting from the right number seventh, that is, I, a string with a length of 4 --InStr (source string, target string, starting string, matching string) = Returns the position of the string to intercept in the source string, starting at the beginning of the character and retrieving it only once--InStr (STRING1,STRING2,INDEX1,INDEX2) said: To string1 in the index1 position, start to find, index2 times, appears string2SelectInStr'miaoying','I',2,2) fromDual--return 6: In other words: start at position 2nd of "miaoying" and find the position of the second occurrence of ISelectInStr'miaoying','k',2,2) fromDual--returns 0: that is, if the lookup is not found, 0 is returnedSelectInStr'miaoying','I') fromDual--returns 2SelectInStr'miaoying','Yi') fromDual--return 5: The position of y of "Yi"SelectInStr'miaoying','I',-1,2) fromDual--return 2:--spaces are also characters ..... Select * fromOmgnode AwhereName like '%miaoying%'Select * fromOmgnode AwhereInStr (Name,'miaoying')>0--Same Effect
SUBSTR () InStr () Usage in Oracle