Danny
Danny

Reputation: 158

MySQL ADD to column

How would I go about "adding" data to existing data in a column?

For an example: I have values

Mary has 2 brothers

in column "family", now I want to ADD

and one sister

to "family" in order to have

Mary has 2 brothers and one sister

Upvotes: 0

Views: 51

Answers (1)

Hotdin Gurning
Hotdin Gurning

Reputation: 1819

If I understand your question clearly, I guess you need concat function in update statement like this :

update your_table
set family = concat(family,' and one sister')
where id = 'blabla'

And this is for select statement :

select concat(family,' and one sister') as family
from your table

Upvotes: 2

Related Questions