MySQL: SPACE Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL SPACE Function

In this guide, we will explain how to use the MySQL SPACE function with syntax and examples.

Description

The MySQL SPACE function returns a string with a specified number of spaces.

Syntax

The syntax for the SPACE function is:

SPACE( number )

Parameters or Arguments

number

The number of spaces to be returned.

Applies To

The SPACE function can be used in the following versions :

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let’s look at some SPACE function examples and explore how to use the SPACE function.

For example:

mysql> SELECT SPACE(3);
Result: '   '

mysql> SELECT SPACE(7);
Result: '       '

Next Topic : Click Here

This Post Has One Comment

Leave a Reply