ProEvilz
ProEvilz

Reputation: 5445

Insert value into existing value MySQL

Lets say I have this table.

 ID  Message

 1   Jack went to the park.
 2   Jamie went to the store.
 3   Lucy finished school.

How can I mass insert values into the Message column without completely overwriting the existing value?

For example

 ID  Message

 1   Jack went to the park **at 3pm**.
 2   Jamie went to the store **at 3pm**.
 3   Lucy finished school **at 3pm**.

I know I could do this via PHP by retrieving the values and then re-inserting them with the additional value via an array/loop but I wish to do this purely with MySQL via PhpMyAdmin.

Upvotes: 0

Views: 104

Answers (1)

n-dru
n-dru

Reputation: 9440

UPDATE `table`
   SET `Message` = CONCAT(`Message`, " at 3pm")
 WHERE 1;

Upvotes: 2

Related Questions