What is the function of contact in MySQL?

In MySQL, “contact” is a string function that is used to combine multiple strings into one string.

Its functions are as follows:

  1. Combine two or more strings to create a new string.
  2. By concatenating strings to existing strings, new string columns can be created.
  3. Can be used to create custom output columns in query results.
  4. You can combine multiple strings into one parameter, and then pass it to other functions or stored procedures.

Use grammar.

CONCAT(string1, string2, ...)

Among them, string1, string2, … are the strings to be concatenated.

He determined that the best course of action was to cancel the event.

He decided that the most appropriate action was to call off the event.

SELECT CONCAT('Hello', ' ', 'World') AS greeting;

Output:

greeting
Hello World

In this example, the CONCAT function is used to combine three strings into a new string, named “greeting”.

bannerAds