MySQL Learning Note: concat, CONCAT_WS, group_concat--string connection

Source: Internet
Author: User

in MySQL, there are 3 main functions for string concatenation:
    • Concat (x, y,...)
    • Concat_ws (delimiter, x, y,...)
    • Group_concat (distinct xxx ORDER by Asd/desc yyy separator ' delimiter ')

First, concat function

The concat () function is used to concatenate multiple strings into a single string

Format: concat (STR1,STR2,...)

--MySQL concat ()--SELECTCONCAT ('I',' Love','Somebody'); # IlovesomebodySELECTCONCAT ('I',NULL,'Somebody'); #NULLSELECTCONCAT (14.4); #14.4

Attention:

If any one of the arguments is NULL, the return value is null;
Returns a non-binary string if all arguments are not binary strings;
Returns a binary string if any twos binary string is included;

MySQL Learning Note: concat, CONCAT_WS, group_concat--string connection

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.