Reputation: 610
I have a component table which has id, query columns. I want to concatenate a string type=bug to the query column for all values. Can it be done using update statement?
udpate dbname.tablename set query=query+"some_string", wiil this work?
Upvotes: 0
Views: 1120
Reputation: 58
If i understand correctly, you can do this with CONCAT(value, ' type=bug') at every field like :
UPDATE `col` SET `col1` = CONCAT(col1, ' type=bug'), SET `col2` ...
Upvotes: 1
Reputation: 530
SELECT CONCAT(Id,' string') AS 'Column' FROM Table. UPDATE TABLE SET COLUMN = CONCAT(Id, ' string')
OR
SELECT (Id + 'string') AS 'Column' FROM Table. UPDATE TABLE SET COLUMN = (Id + 'String')
Upvotes: 0