Oracle-空值null和數字相加的問題-nvl函式

ZHOU_VIP發表於2017-03-17

select t.RECORD_ID as recordId,
       t.HOST_ID as hostId,
       t.HOST_NO as carHostNO,
       t.SECURE_PAY as securePay,
       p.VEHICLE_MODEL as vehicleModel,
       po.APPSYSID as appSysId,
       po.APPDEPTID as appDeptId,
       t.SECURE_NO as secureNo,
       to_char(t.SECURE_START_TIME, 'yyyy-MM-dd HH24:mi:ss') as secureStartTime,
       to_char(t.SECURE_END_TIME, 'yyyy-MM-dd HH24:mi:ss') as secureEndTime,
       t.SECURE_HANDLE as secureHandle,
       t.secure_acc_no as secureAccNo,
       t.secure_acc_pay as secureAccPay,
       t.secure_tax as secureTax,
       t.secure_remark as secureRemark,
       (t.SECURE_PAY + t.secure_acc_pay + t.secure_tax) as SECURE_NUM
  from CAR_SECURE_NEW t, POSITION_HOST_INFO_EXTEND p, POSITION_HOST_INFO po
 where t.host_id = p.hostid
   and t.host_id = po.hostid


解決辦法:若有空值,要用nvl函式來處理



相關文章