Tanya
Tanya

Reputation: 1621

Update a column of a table with append some values to the same column value in MySQL

Lock issue occurred when i tried to update a Column of a table with concatenate the same column value with some characters.

UPDATE Templates 
   SET TemplateName = CONCAT("'", (SELECT TemplateName 
                                           FROM Templates 
                                          WHERE LogID = 2), '_Validated',"'")
 WHERE LogID = 2; 

Is there any possible ways to achieve this?

Upvotes: 0

Views: 3059

Answers (1)

OMG Ponies
OMG Ponies

Reputation: 332531

Use:

UPDATE TEMPLATES
   SET TemplateName = CONCAT("'", templatename, '_Validated')
 WHERE LogID = 2

Upvotes: 4

Related Questions