MySQL string correlation function learning a

Source: Internet
Author: User

Here's a summary of some of the commonly used or possible string built-in functions

①ASCII (): Returns the ASCII code of the character

What if the input is not a character but a string? ASCII () takes only the first character as a computed parameter, such as:

②char (): Receives a number that returns its corresponding character, and if it is a decimal, it is rounded first, and then the corresponding character is returned.

③char_length (): Returns the length of the character, as it is synonymous with character_length ()

④concat (): Returns a concatenated string

⑤CONCAT_WS (): Concatenate a string with a given delimiter, note that the separator is the first parameter

⑥elt (): Returns the string as a result

⑦field (): Similar to ELT (), retrieves whether STR is in str1, str2, STR3, if there is a return index value, there is no return 0

⑧format (): Returns the number of formatted processing

⑨insert (): Replace part of a string

The first parameter is the string to be replaced

The second parameter indicates where to start the replacement

The third parameter represents the number of replacement characters

The fourth parameter indicates the string to be replaced

If the number of replacement characters actually exceeds the length of the original string, then the replaced string is made up of an unused part + a string of substituted strings, such as:

⑩INSTR (): Returns the position of the first occurrence of a substring in a string, if there is a return index, there is no return 0

MySQL string correlation function learning a

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.