SUBSTR () InStr () Usage in Oracle

Source: Internet
Author: User

--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

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.