how to integrate new data with existing data in a column in mysql?


Problem :

i want to integrate data with exiting data in a column in phpmyadmin.

for example i have a table which has a column (ticket_number).

And its exiting value is 234 and want to add '1' before 234 so that the value will be 1234. this below written code not working for this.

UPDATE ticket
SET `ticket_number`+= '1';

thanks in advance.



Solution :

Try using CONCAT:

UPDATE ticket
SET ticket_number = CONCAT(1,ticket_number)

Because if you add up the "1" directly you'll get 235 not 1234...


Mysql Tutorials

Mysql Howto..

How to Prevent Concurrent User Logins in PHP/MySQL Site?

How to Connect to A MySQL DB and Get Tables Using Hostname and Credentials?

How to load blob from image variable in PHP

how to access mysql table from wamp database using this php code?

how to break array into chunks and post them to mysql? [closed]

How to parse xml data efficiently?

How to filter on a date in MySQL and PHP?

How can I dump a MySQL database from mysql c library

How to bind SQL variables in Php?

How to install Mono mysql connector on ubuntu server

how to solve com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'task4DB.tst' doesn't exist exceptions

MySql how to automatically apply discounts?

mysql c++ connector, how to keep the connection alive and reconnect if connection is broked?

How to run a java program on a server?

how to use range value search in mysql

is there a mysql limit as to how many people can request data from database?

How to prevent mysql implicit commit

How do I handle MySQL to Javascript Date Format?

how to INSERT a NULL value in mysql, taken from a variable. ASP

how to get django to read MySQL password from my.cnf?

How to detect deadlocks in Mysql / innodb?

how to select @domain from email and match from another table with mysql

How to check if a record with a specific primary key exists in a MySql table from JDBC

sql injection - how do i know what data has been compromised? [closed]

how to define which mysql driver to use on pentaho kettle 4.2.0?

How to check field data type consistent during insert record using pdo mysql

How to grant MySQL privileges in a bash script?

How to Pass input parameters to Spring restful web service method using model class as inputs & execute MySql stored procedure

How to index innodb text in mysql?

How to add together the results of several subqueries?