Reputation: 214
In a SQL table I have two columns: the first contain a path and the second contains a value.
colunm1 | /path/ |
---|---|
colunm2 | 12345 |
I need to update the first column with the value that exists in the second column. to get this result :
colunm1 | /path/12456/ |
---|
I tried this, but not working
update tablename p
set p.colunm1 = "/path/'colunm2'/"
Upvotes: 0
Views: 484
Reputation: 49410
You have to use CONCAT
update tablename p
set p.colunm1 = CONCAT("/path/",`colunm2`,"/");
Upvotes: 1