Home  >  Article  >  Database  >  Which function in MySQL is used to add a space between two strings?

Which function in MySQL is used to add a space between two strings?

WBOY
WBOYforward
2023-08-24 19:13:02901browse

MySQL 中的哪个函数用于在两个字符串之间添加空格?

MySQL SPACE() function is used to add a space between two strings. The argument passed in the SPACE() function is an integer that specifies how many spaces we want to add.

Syntax

SPACE(N)

Here, N is an integer specifying the number of spaces we want to add.

Example

mysql> Select 'My Name is', Space(5), 'Ram';
+------------+----------+-----+
| My Name is | Space(5) | Ram |
+------------+----------+-----+
| My Name is |          | Ram |
+------------+----------+-----+
1 row in set (0.00 sec)

In the above example, the SPACE() function adds 5 spaces between strings.

The above is the detailed content of Which function in MySQL is used to add a space between two strings?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete