美文网首页
SQL语句把某一列的所有值前面加一个前缀

SQL语句把某一列的所有值前面加一个前缀

作者: HAO延WEI | 来源:发表于2020-12-04 16:47 被阅读0次

更新 (为该列的值加上固定前缀-修改数据库数据表):

 update car_koubei_details set series_id=concat('sb_',series_id) where id=146467;
"""
 update table set column=concat('exp_',column) where id=146467;
"""

查询加上前缀(不修改数据库):

 select *,concat('wz',column1) as column1 from table where column='xx'

相关文章

网友评论

      本文标题:SQL语句把某一列的所有值前面加一个前缀

      本文链接:https://www.haomeiwen.com/subject/fydiwktx.html