Jump to: navigation, search

Mysql CONCAT

From w3cyberlearnings

Contents

MySQL CONCAT Function

This function returns string from concatenating all the given arguments.

Syntax CONCAT

  • str1: string input 1
  • str2: string input 2
  • str3: string input 3
CONCAT(str1, str2, str3,..);

Example 1

mysql> SELECT CONCAT('First Name', ' ','Last Name') as Name;
+----------------------+
| Name                 |
+----------------------+
| First Name Last Name |
+----------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT CONCAT('address1',' ','city',' ','country') as address;
+-----------------------+
| address               |
+-----------------------+
| address1 city country |
+-----------------------+
1 row in set (0.00 sec)

Related Links


Navigation
Web
SQL
MISC
References