最後10分:oracle 字段為空問題
select ORDER_NO,sum(case when (ORDER_STATUS = 'Y ') then ORDER_QTY else 0 end) as 一周業務已確認訂單量,sum(case when (ORDER_STATUS is null or ORDER_STATUS = 'H ') then ORDER_QTY else 0 end) 一周業務未確認訂單量
from ORDER_HEAD_V6
where to_char(SHIPPING_DATE, 'yyyy-MM-dd ') > = '2007-09-16 ' and to_char(SHIPPING_DATE, 'yyyy-MM-dd ') <= '2007-09-22 '
group by ORDER_NO
一周業務未確認訂單量全為0
------解决方案--------------------null or ' ' 考虑了没有?