sql-server

9 Пост

oracle

8 Пост

postgresql

12 Пост

my-sql

2 Пост

common-sql

2 Пост

News

5 Новости

Concat функция
Concat функция Имеет Эквивалент в

In MySQL, the CONCAT() function joins (concatenates) multiple strings into one.

CONCAT(str1, str2, ..., strN)

Return value

  • Returns a single string formed by joining all input strings.
  • If any argument is NULL, the result is NULL.

Examples

Simple concatenation

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

Result: Hello World

Important behavior (NULL)

SELECT CONCAT('Hello', NULL, 'World');

Result:NULL

If you want to ignore NULL values, use:

CONCAT_WS(separator, str1, str2, ...)

Example:

SELECT CONCAT_WS(' ', 'Hello', NULL, 'World');

Result:

Hello World