In oracle, The _ instr function is similar to indexof.

Source: Internet
Author: User

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 groups of data. the first 1 is from the left, and if it is-1, it starts from the right. 4. The second one is the number of times the city appears. Www.2cto.com is encoded in GBK format. A Chinese Character occupies two bytes: select instr ('baoding city South', 'city', 1, 1) from dual; the value is 5 select instr ('baoding city South', 'city', 1, 2) from dual; the value is 9 select instr ('baoding city South', 'city ', -) from dual; the value is 9 select instr ('South city of Baoding City ', 'city',-) from dual; the value is 5 author qyongkang

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.