oracle 查詢前7天的數據


select nvl(t1.xfc,0) as hj,substr(t.today,6,5) as rq from
(select to_char (sysdate-level + 1,'yyyy-mm-dd') today from dual connect by level <=7 ) t,
(select count(t.運單編號) as xfc,to_char(t.寄件日期,'yyyy-MM-dd') as rq from tab_寄件運單表 t where t.寄件客戶編號='KVN01' group by to_char(t.寄件日期,'yyyy-MM-dd')) t1
where t.today=t1.rq(+) order by t.today;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM