Collections:
CONCAT() - Concatenating Strings
How to concatenate multiple strings together using the CONCAT() function?
✍: FYIcenter.com
CONCAT(string1, string2, ...) is a MySQL built-in function that concatenates multiple strings together. For example:
SET @host = 'dba'; SET @domain = 'FYIcenter.com'; SELECT CONCAT(@host, '.', @domain); -- +-----------------------------+ -- | CONCAT(@host, '.', @domain) | -- +-----------------------------+ -- | dba.FYIcenter.com | -- +-----------------------------+
Reference information of the CONCAT() function:
CONCAT(str1, str2, ...): str Returns the string that results from concatenating the arguments. May have one or more arguments. If all arguments are nonbinary strings, the result is a nonbinary string. If the arguments include any binary strings, the result is a binary string. A numeric argument is converted to its equivalent nonbinary string form. Arguments, return value and availability: str1: Required. The first given string to concatenate for. str2: Optional. The second given string to concatenate for. str: Return value. The string of concatenation of all given strings. Available since MySQL 4.0.
Related MySQL functions:
⇒ CONCAT_WS() - Concatenation with Separator
⇐ COLLATION() - Detecting Character Collation Name
2023-11-10, 220🔥, 0💬
Popular Posts:
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
How To Generate CREATE VIEW Script on an Existing View in SQL Server? If you want to know how an exi...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time valu...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...