COALESCE(a.floor_num, 0) as floor_num

此函数是有用的,但是使用报错,结果如下

postgresql处理字段数据为空转为0的方法

检查后发现时字段类型转义错误,floor_num是varchar类型,需要加上引号

COALESCE(a.floor_num, ‘0’) as floor_num

postgresql处理字段数据为空转为0的方法

执行正确。

 

相关文章:

  • 2021-12-17
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2021-07-02
  • 2022-12-23
  • 2021-10-10
相关资源
相似解决方案