select sum(decode(status,'1',1,0)) 订购单数, sum(decode(status,'1',prodprice,0)) 订购金额, sum(decode(status,'2',1,0)) 发货单数, sum(decode(status,'2',prodprice,0)) 发货金额, sum(decode(status,'6',1,0)) 拒收单数, sum(decode(status,'6',prodprice,0)) 拒收金额, sum(decode(status,'0',1,0)) 取消单数, sum(decode(status,'0',prodprice,0)) 取消金额, sum(decode(status,'5',1,0)) 完成单数, sum(decode(status,'5',prodprice,0)) 完成金额, sum(decode(status,'7',1,0)) 压单单数, sum(decode(status,'7',prodprice,0)) 压单金额 from iagentnew.v_orderhist where crdt between to_date('2008-01-01 0:0:0','yyyy-mm-dd hh24:mi:ss') and to_date('2008-01-08 0:0:0','yyyy-mm-dd hh24:mi:ss') and orderid not in (select orderid from iagentnew.v_orderhist where crdt between to_date('2008-01-01 0:0:0','yyyy-mm-dd hh24:mi:ss') and to_date('2008-01-08 0:0:0','yyyy-mm-dd hh24:mi:ss') and status='0' and senddt is null) crdt 日期 现在要做的是,把上边的代码修改加入一个日期,并按照日期,以天为单位汇总数据,按日期升序排列,这个应该怎么修改?谢谢 |