案例一:

使用python查询mysql:select  money from amount where amount_

此时查询出的money结果为10000,类型为Decimal。

无法进行后续的运算和字符串拼接操作。

解决方法:

将sql改造为:select CAST(money as CHAR) as money from amount where amount_

此时查询出的money结果为10000,类型为str。

后续可将str转换为int或直接拼接

相关文章:

  • 2021-12-15
  • 2022-02-28
  • 2021-11-28
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
猜你喜欢
  • 2021-08-03
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-08-16
  • 2021-11-16
  • 2021-08-06
相关资源
相似解决方案