MySQL string processing function concat_ws ()

Source: Internet
Author: User

The MySQL string processing function concat_ws () is similar to the MySQL string processing function concat), but the processed strings are not the same. The following describes the MySQL string processing function concat_ws () in detail ().

Concat_ws () function, indicating concat with separator, which has a separator string connection
For example, separate the strings with commas (,).

 
 
  1. mysql> select concat_ws(',','11','22','33');  
  2.  
  3. +-------------------------------+  
  4. | concat_ws(',','11','22','33') |  
  5. +-------------------------------+  
  6. | 11,22,33      |  
  7. +-------------------------------+  
  8.        1 row in set (0.00 sec)  

Unlike concat, The concat_ws function does not return NULL because of the NULL value during execution.

 
 
  1. mysql> select concat_ws(',','11','22',NULL);  
  2. +-------------------------------+  
  3. | concat_ws(',','11','22',NULL) |  
  4. +-------------------------------+  
  5. | 11,22 |  
  6. +-------------------------------+  
  7.        1 row in set (0.00 sec)  

How to view the three MySQL character sets

View MySQL Default Character Set

How MySQL defines foreign keys

MySQL foreign key syntax

MySql stored procedure with Parameters

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.