通过查询获得某个字段的合计值,如果这个值位null将给出一个预设的默认值 select nvl(ob.bookingvalue,0) bookingvalue from blis_order o, blis_orderbooking ob where o.orderid=ob.orderid and o.orderid =125034 and ob.bookingtypeid = 215 and ob.status = 'Active'这里关心nvl的用法,nvl(arg,value)代表如果前面的arg的值为null那么返回的值为后面的value