mysql concat
时间: 2023-10-26 16:49:26 浏览: 152
Mysql数据库使用concat函数执行SQL注入查询
5星 · 资源好评率100%
The CONCAT function in MySQL is used to concatenate two or more strings into a single string. It takes two or more string arguments and returns a single string that is the result of concatenating the input strings.
Syntax:
CONCAT(string1, string2, ...)
Example:
SELECT CONCAT('Hello', 'World');
Output:
HelloWorld
In addition to the CONCAT function, MySQL also provides the CONCAT_WS function which allows you to specify a separator between the input strings.
Syntax:
CONCAT_WS(separator, string1, string2, ...)
Example:
SELECT CONCAT_WS('-', 'John', 'Doe', 'Smith');
Output:
John-Doe-Smith
阅读全文