How to update mysql table without deleting existing content
I have a mysql table
mysql_table. There is a column
Cid for category id. I already uploaded many data in that table.
In first row, i upload ~1~2~3~ in Cid In second row, i upload ~3~5~ in Cid In third row , I upload ~1~ in Cid
Now i want to update column Cid of table mysql_table without affecting existing data. I want to update each Cid column with 15~. So that i need final reasult as
first row , ~1~2~3~15~ second row, ~3~5~15~ third row, ~1~15~
How Can I achieve this using mysql update query ?
You can use concat to update the existing column as
update mysql_table set Cid = concat(Cid,'15~');
- A Linux, Apache, MySQL, PHP (LAMP) stack is a combination of open source software that is typically installed together to enable a server to host dynamic […]
- MySQL is an the most popular open-source database management system, in most of hosting company its has been bundle by LAMP(Linux, Apache, MySQL, PHP/Python/Perl) stack. Another alternative […]
- MySQL is the world’s most popular open-source database. Despite its powerful features, MySQL is simple to set up and easy to use. Below are some instructions […]