Home > Database > Mysql Tutorial > body text

How to use the SPACE() function with MySQL column data?

WBOY
Release: 2023-08-23 22:09:11
forward
604 people have browsed it

如何将 SPACE() 函数与 MySQL 的列数据一起使用?

MySQL table column names can be used with the SPACE() function to add spaces between two columns, after or before a specified column. The following uses the data of the "Student" table as an example for demonstration.

Example

mysql> Select Id, Space(8),Name from Student;
+------+----------+---------+
| Id   | Space(8) | Name    |
+------+----------+---------+
| 1    |          | Gaurav  |
| 2    |          | Aarav   |
| 15   |          | Harshit |
| 20   |          | Gaurav  |
| 21   |          | Yashraj |
+------+----------+---------+
5 rows in set (0.00 sec)
Copy after login

In the above example, 8 spaces are added between two columns as one column.

The above is the detailed content of How to use the SPACE() function with MySQL column data?. 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!