Reputation: 101
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.
Upvotes: 2
Views: 105
Reputation: 16223
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...
Upvotes: 6
Reputation: 4310
Probably something like this:
UPDATE ticket
SET ticket_number = '1' + ticket_number
MySQL doesn't understand +=
Upvotes: 3
Reputation: 3710
Because your data is probably stored as an integer, you would need to add 1000 not 1.
You could provide some more information about the field type.
Upvotes: 2