- Trending Categories
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
Adding characters in values for an existing int column in MySQL?
To add characters to an existing int column values, use MySQL CONCAT(). Let us first create a table −
mysql> create table DemoTable ( Amount int ); Query OK, 0 rows affected (1.44 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(709); Query OK, 1 row affected (0.67 sec) mysql> insert into DemoTable values(34560); Query OK, 1 row affected (0.30 sec) mysql> insert into DemoTable values(90854); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable values(3456); Query OK, 1 row affected (0.15 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+--------+ | Amount | +--------+ | 709 | | 34560 | | 90854 | | 3456 | +--------+ 4 rows in set (0.00 sec)
Following is the query to add characters in column values −
mysql> select concat('The Product Amount is=',Amount) AS AddingCharacters from DemoTable;
This will produce the following output −
+-----------------------------+ | AddingCharacters | +-----------------------------+ | The Product Amount is=709 | | The Product Amount is=34560 | | The Product Amount is=90854 | | The Product Amount is=3456 | +-----------------------------+ 4 rows in set (0.00 sec)
- Related Articles
- Adding new enum column to an existing MySQL table?
- Set conditions while adding column values in MySQL?
- Adding a new column to an existing DataFrame in Python Pandas
- Adding new column to existing DataFrame in Pandas
- Append special characters to column values in MySQL
- Shifting values of rows in MySQL to change the existing id values for existing rows?
- Adding a new column to existing DataFrame in Pandas in Python
- Adding a new NOT NULL column to an existing table with records
- How to rename a column in an existing MySQL table?
- Set NOT NULL attribute to an existing column in MySQL
- Set ENUM in MySQL for column values
- MySQL query to remove special characters from column values?
- Assigning multiple characters in an int in C language
- How to increase varchar size of an existing column in a database without breaking existing data in MySQL?
- Set existing column as Primary Key in MySQL?

Advertisements