• TestingDocs
TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL CONCAT Function

Overview

In this tutorial, we will learn about MySQL CONCAT Function with some examples. We can use this function to concatenate strings. Concatenation is combining strings together into one string.

MySQL CONCAT Function

CONCAT() function concatenates the given arguments into one combined string.

Syntax

The general syntax of the function is as follows:

CONCAT(<arg1> [,<arg2>, …., <argn>])

The concatenation operation works with strings and MySQL will convert any other data types
to string first to perform the concatenation.

Examples

Let’s concatenate two strings into one string.

mysql> SELECT CONCAT(‘Hello’,’World’);

Output
+————————-+
| CONCAT(‘Hello’,’World’) |
+————————-+
| HelloWorld |
+————————-+
1 row in set (0.00 sec)

CONCAT String Function

In the example, we have used the CONCAT() function to combine two strings ‘Hello’ and ‘World’ 

#

Let’s concatenate three strings into one string.

mysql> SELECT CONCAT(‘Testing’,’Docs’,’.com’);

+———————————+
| CONCAT(‘Testing’,’Docs’,’.com’) |
+———————————+
| TestingDocs.com |
+———————————+
1 row in set (0.01 sec)

 

MySQL CONCAT Function

mysql> SELECT CONCAT(‘A’,’quick’,’brown’,’fox’);
+———————————–+
| CONCAT(‘A’,’quick’,’brown’,’fox’) |
+———————————–+
| Aquickbrownfox |
+———————————–+

MySQL CONCAT Function

#

We can also concatenate database table columns using this function.

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

MySQL /

How to secure your SQL Database: Tips and Tricks

DataGrip Desktop Shortcut

MySQL /

Launch DataGrip on Windows

DataGrip Download

MySQL /

Install DataGrip IDE on Windows 11

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

‹ MySQL String Functions› MySQL REVERSE Function

Recent Posts

  • How to secure your SQL Database: Tips and Tricks
  • Shaping the Future of Development: Exploring Key Trends in Software Engineering
  • Improving Java Performance with Multithreading
  • Difference between PHP and JavaScript?
  • Bing Conversation Styles
  • ChatGPT Introduction
  • Open Source AI Frameworks
  • Artificial Intelligence Tools
  • Top AI Music Applications
  • Top AI Website Design Tools

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com