A brief analysis of Mysql's string function _mysql

Source: Internet
Author: User

1. Left function to intercept the string contents of the query field, using the Select Left (content,50) as summary from article; The meaning here is to query only the first 50 characters of the content column, where the Chinese character is used only as a single character.

2. Right function, in contrast to the left function, intercepts the content from the back.

3. The upper function, which capitalizes the lowercase letters in the contents of the query. Select Upper (title) as title from article;

4. Lower function, and upper just the opposite, it is lowercase processing.

5. The SUBSTR function, which cuts the specified length from the specified position, is more flexible than left and right. Select substr from article to intercept 50 characters from the 10th character (the first character 1 is not 0), select substr (content,10) from article, and the 10th Word Character begins to intercept to the end, select substr (content,–20) from article, and 20 characters from the end.

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.