"MySQL must know" study notes (iii)

Source: Internet
Author: User

Concat is used to splice strings, such as Select Concat (RTrim (Vend_name), ' (', RTrim (vend_country), ') ') from vendors;

Where RTrim is used to remove the right side of the space, concat in multiple strings, connected.

In addition, it is usually accompanied by the use of a field alias to be called at the client.

You can also calculate with arithmetic in the selected field, such as select Price*count as total from product;

Text-handling functions:

RTrim Remove the right space

Upper to uppercase

Left returns the character

Length return string lengths

Locate find the substring of a string

Lower Turn lowercase

LTrim go to left space

Right returns the string

Soundex returns the Soundex value of the string

SUBSTRING return substring characters

(Soundex converts any text string to an algorithm that describes the alphanumeric pattern of its speech representations, taking into account similar sounds at the ego and syllable to compare strings rather than letters)

Select AVG (distinct type) from product can be used with distinct and aggregation parameters;

"MySQL must know" study notes (iii)

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.