How can I use SPACE() function with MySQL WHERE clause?


In this case, SPACE() function would add white spaces depending upon the condition given in WHERE clause. The following example from student table will demonstrate it.

Example

mysql> Select Id,Name,Space(5) from student WHERE Name='Harshit';
+------+---------+----------+
| Id   | Name    | Space(5) |
+------+---------+----------+
| 15   | Harshit |          |
+------+---------+----------+
1 row in set (0.00 sec)

Updated on: 10-Feb-2020

208 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements