Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2023-08-24 19:13:02
forward
901 people have browsed it

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)
Copy after login

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!