当前位置: 代码迷 >> 综合 >> 批量操作数据库某一字段连接1
  详细解决方案

批量操作数据库某一字段连接1

热度:11   发布时间:2024-02-20 08:06:11.0

1.update 表名 set name= concat(name,"1") where 条件

2.批量更改数据库某一个字段的值舍去最后一位

update 表名 set mobile= left(mobile,CHAR_LENGTH(mobile) - 1) where 条件

3.两表关联并批量修改数据库某一字段的值舍去最后一位

update 表名1,表名2
set 表名1.mobile=left(表名1.mobile,CHAR_LENGTH(表名1.mobile) - 1)
where 表名1.merchantid=表名2.id and 条件

  相关解决方案