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