SQL批量替换字段名问题

版本:Navicat Premium 12
描述:在查询界面update [ABC] set sex = replace(sex,'男','1')后报错,sex字段名为varchar类型。
报错信息:update [ABC] set sex = replace(sex,'男','1')

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[ ABC]set sex = replace(sex,'男','1')' at line 1
时间: 0s

  求大神指点,大概要替换20W条数据

update abc set sex=replace(sex,'男','1')
你的表名可能出错了,哪有[ABC]这种奇奇怪怪的名字
另外还可以update abc set sex=1 WHERE sex='男'进行替换

将表名与字段名 加上反引号试试