SelectId,Space(8),NamefromStudent;+------+----------+---------+|Id |Space(8)|Name |+------+----------+---------+|1 |&nbs"/> SelectId,Space(8),NamefromStudent;+------+----------+---------+|Id |Space(8)|Name |+------+----------+---------+|1 |&nbs">

Home >Database >Mysql Tutorial >How to use the SPACE() function with MySQL column data?

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

WBOY
WBOYforward
2023-08-23 22:09:11683browse

如何将 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)

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!

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