1. 程式人生 > >ERROR: invalid input syntax for type double precision: ""

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的時候會報錯誤;