MySql中转换字段的null值为0

 copy
  1.  
  2. (
  3. CASE WHEN 
  4.           I.VEHICLE_COST_AMOUNT IS NOT NULL AND I.VEHICLE_COST_AMOUNT != " "
  5.   THEN
  6.          I.VEHICLE_COST_AMOUNT
  7.   ELSE
  8.          0
  9.   END
  10.   )    AS   VEHICLE_COST_AMOUNT
  11.  
  12.  注意: AS 后面的字段不能有表名称



          


你可能感兴趣的:(SQL)