Mysql DATA character connection function CONCAT
Mysql DATA character connection function CONCAT
CONCAT () is a string connection function.
REPLACE () is a string replacement function.
CONCAT (parameter 1, parameter 2 ,...)
CONCAT (string, from_str, to_str)
Returns the str string, which is replaced by the to_str string.
The derivative functions are concat_ws (separator, string1, string2 ,...)
It differs from concat in that after a connection, there is a separator character in the connection. For example:
Update users set homedir = concat_ws ('/', '/data/disk1', 'part1', 'user1') where userid = 'user1 ';
The result is homedir = '/data/disk1/part1/user1' of user1'
CONCAT (str1, str2 ,...)
Returns the string that results from concatenating the arguments. returns NULL if any argument is NULL. may have one or more arguments. if all arguments are non-binary strings, the result is a non-binary string. if the arguments include any binary strings, the result is a binary string. A numeric argument is converted to its equivalent binary string form; if you want to avoid that you can use explicit type cast, like in this example: select CONCAT (CAST (int_col as char ), char_col)
Mysql> select CONCAT ('My, s', 'ql ');
-> 'Mysql'
Mysql> select CONCAT ('My, NULL, 'ql ');
-> NULL
Mysql> select CONCAT (14.3 );
-> '14. 3'