造成原因:

当两个字段想减时,如果其中一个或两个字段的类型的unsigned无签名类型,如果想减的值小于0则会报错(BIGINT UNSIGNED value is out of range)

处理办法:

例:select a - b from table

改:select if(a >= b, a - b, - (b - a)) from table

相关文章:

  • 2022-12-23
  • 2021-09-04
  • 2021-10-25
  • 2021-06-03
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
猜你喜欢
  • 2022-02-11
  • 2021-05-21
  • 2022-02-26
  • 2021-08-02
  • 2022-12-23
  • 2021-10-07
  • 2021-09-07
相关资源
相似解决方案