- 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 replicate a string for a specified number of times in MySQL?
With the help of MySQL REPEAT() function, we can replicate a string for a specified number of times.
Syntax
REPEAT(Str, No.)
Here
- Str is the string which is to be replicated for a specified number of times.
- No. is the numerical value which indicates that how many times the string would be repeated.
Example
mysql> Select REPEAT('#*',5); +----------------+ | REPEAT('#*',5) | +----------------+ | #*#*#*#*#* | +----------------+ 1 row in set (0.00 sec)
Advertisements