Oracle Function Notes

Source: Internet
Author: User

SUBSTR () and SUBSTRB () differ in the interception of Chinese characters, a Chinese character may account for 2 or 3 characters, substr () the length of the Intercept refers to the length of the string, the length of the SUBSTRB () is the length of the character that the string occupies. Examples are as follows: Select substr (' ha ha ha haha ', 1,6) from dual; haha haha select substrb (' hahaha haha ', 1,6) from dual; --Using the library a Chinese character is 3 characters, UTF-16 haha select substr (' [Email protected]#$%^&* () ', 1,16) from dual; [Email protected]#$%^&* () Select SUBSTRB (' [Email protected]#$%^&* () ', 1,16] from dual; [Email protected]#$%^&* () decode () format is decode (expr,v_1,value_1,v_2,value_2,..., v_n,value_n,default), if the value of expr is V _1, the Value_1 is returned, the value is V_2, value_2 is returned, or default is returned if there is no value in the list that matches expr. Here, the null value is considered equivalent to the null value. Select Decode (mod (10,3), 1, ' remainder 1 ', 2, ' 2 ', ' divisible ') res from dual; --1select Decode (mod (11,3), 1, ' remainder 1 ', 2, ' 2 ', ' divisible ') res from dual; --2select Decode (mod (12,3), 1, ' remainder 1 ', 2, ' 2 ', ' divisible ') res from dual; --Divisible

Oracle Function Note

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.