
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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)
- Related Articles
- How to repeat column values in R data frame by values in another column?
- How do I select data from one table only where column values from that table match the column values of another table in MySQL?
- How to repeat column values in R matrix by values in another column?
- How to write a MySQL stored function that updates the values in a table?
- How to repeat column values of a data.table object in R by number of values in another column?
- How can column data values of a table be compared using MySQL STRCMP() function?
- How to create a column of absolute values in data frames stored in R list?
- How to create a column of factorial values in data frames stored in R list?
- How to create a column of rounded values in data frames stored in R list?
- How to write a MySQL stored function that inserts values in a table?
- Insert data in a table in MySQL stored procedure?
- How to change the column position of MySQL table without losing column data?
- How can we add a time interval to date stored in a column of MySQL table?
- How to delete the duplicate values stored in reverse order from MySQL table?
- How can I create a stored procedure to insert values in a MySQL table?

Advertisements