报错信息:

[SQL]
UPDATE 表 set times = 1 where type = 1 and times = 0

[Err] 1292 - Truncated incorrect DOUBLE value: 'a'

 

解决方案:

属于类型错误,type为vachar类型,具体是什么样的查询顺序我也不太清楚。经过测试,

我觉得是 times = 0 的条件中,含有 type = a 的结果,所以 user_type=1,需要添加单引号。

 

结果:

UPDATE 表 set times = 1 where type = '1' and times = 0

 

最后:

一定要严格写sql,vachar类型的一定用单引号,否则索引都使用不上。

相关文章:

  • 2021-06-26
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-10-16
相关资源
相似解决方案