我所知道的是,您可以使用MYSQL中的concat函数从查询中追加值。
>col1 = ben
UPDATE table set col1 = concat(col1, ' altered')
>col1 = ben altered但是我想要实现的是在任何地方都要附加。
col1 = ben
UPDATE table set col1 = "altered " + col1
-- pseudo code
col1 = altered ben在mysql中有此功能吗?
发布于 2016-06-30 15:22:01
如果要在列之前添加,只需更改concat序列
UPDATE table set col1 = concat('altered ' , col1 )您可以选择所有您喜欢的列和值。
concat('altered ' , col1, ' altered')
concat('altered ' , col1, ' altered', col2, col3, 'altered again')https://stackoverflow.com/questions/38127268
复制相似问题