
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can I use SPACE() function along with MySQL’s column data?
MySQL table’s column name can be used along with SPACE() function to add white spaces between two column, after or before a specified column. Following the example from the data of ‘Student’ table is used to demonstrate it.
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 white spaces have been added as a column between two columns.
- Related Articles
- How can I use SPACE() function with MySQL WHERE clause?
- How can we use MySQL REVERSE() function on column’s data along with WHERE clause?
- How can I use MySQL INTERVAL() function with a column of a table?
- How can I use another MySQL function/s with REPEAT() function?
- How can I use MySQL OCTET_LENGTH() function to count the number of characters stored in a data column?
- How can we use MySQL EXPORT_SET() function with column of a table?
- How can I clone/duplicate the table along with its data, trigger and indexes?
- How can we use MySQL POWER() function with the column’s data values?
- How can we use MySQL function STR_TO_DATE(Column, ‘%input_format’)?
- While fetching the data as output, how can I use multiple conditions on same column?
- How MySQL evaluates if I store date along with time value in a column having DATE data type?
- Can we use IFNULL along with MySQL ORDER BY?
- In MySQL, when VARCHAR data type will use 1-byte and when 2-bytes prefix length along with data?length along with data?
- How can I use MySQL IF() function within SELECT statement?
- How can I modify an existing column's data type?

Advertisements