ERROR: invalid input syntax for type double precision: ""

当我在做乘法相乘的时候出现的问题:这种空的情况就不能统一下,

空值的表达有几种:

1、不为空

Select   *   From   table Where id<>''

Select   *   From   table Where id!=''

2、为空

Select   *   From   table Where id=''

Select   *   From   table Where   IS NULL(id)

如果字段是类型是字符串,用 id=''可以;如果是int型则用 IS NULL
如果有空值参与相乘,或者是做cast as的时候会报错误;

猜你喜欢

转载自blog.csdn.net/weixin_38859557/article/details/85049341
今日推荐