String Functions

MySQL includes many functions that can be used to manipulate strings. You learn the most useful functions in this section.

String Functions

Refer to the online manual for the full list of string functions: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html.

Concatenation

Joining two or more strings is known as concatenation. It is performed using the CONCAT() function.

mysql> SELECT CONCAT('exam', 'ple');
+-----------------------+
| CONCAT('exam', 'ple') |
+-----------------------+
| example               |
+-----------------------+
1 row in set (0.00 sec)

The CONCAT() function can accept more than two arguments and returns a single ...

Get Sams Teach Yourself MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.