How to repeat the values stored in a data column of MySQL table?

MySQLMySQLi Database

For repeating the values stored in a data column of MySQL table, the name of the column must be passed as the first argument of REPEAT() function. The data from ‘Student’ table is used to demonstrate it:

Example

mysql> Select REPEAT(Name,3)AS Name from student;
+-----------------------+
| Name                  |
+-----------------------+
| GauravGauravGaurav    |
| AaravAaravAarav       |
| HarshitHarshitHarshit |
| GauravGauravGaurav    |
| YashrajYashrajYashraj |
+-----------------------+
5 rows in set (0.00 sec)
raja
Published on 20-Feb-2018 10:52:41
Advertisements