- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to repeat the values stored in a data column of MySQL table?
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)
Advertisements