sql语句批量修改字段

1、 根据条件去掉指定记录的前2个字符 update 表名 set 字段名=REPLACE(字段名,字段名,SUBSTR(字段名,1,2)) where 条件; 简单例子: update test set name=REPLACE(name,name,SUBSTR(name,1,2)) where number=1 SUBSTR函数的简单用法 substr(字符串,截取开始位置,截取长度)//返回
相关文章
相关标签/搜索