select b.bureau_no,count(DISTINCT a.ord_no)
from ibss.tba_ask_list a,ibss.tsm_site b,ibss.tba_phs_ask c
where a.sequ='0'
and a.state<>'6'
and a.serv_no like '2J%'
and a.ord_no=c.ord_no
and a.site_no=b.site_no
and trunc(a.CREATE_date) = trunc(sysdate) - 7
and trunc(a.CREATE_date) < trunc(sysdate)
group by b.bureau_no 不包括当天的数据,如果要当天的数据就
改为
and trunc(a.CREATE_date) = trunc(sysdate) - 6
and trunc(a.CREATE_date) < trunc(sysdate)+1
这样效率低了点。
from ibss.tba_ask_list a,ibss.tsm_site b,ibss.tba_phs_ask c
where a.sequ='0'
and a.state<>'6'
and a.serv_no like '2J%'
and a.ord_no=c.ord_no
and a.site_no=b.site_no
and trunc(a.CREATE_date) = trunc(sysdate) - 7
and trunc(a.CREATE_date) < trunc(sysdate)
group by b.bureau_no 不包括当天的数据,如果要当天的数据就
改为
and trunc(a.CREATE_date) = trunc(sysdate) - 6
and trunc(a.CREATE_date) < trunc(sysdate)+1
这样效率低了点。
解决方案 »
- 存储过程的权限
- restore database using backup controlfile until cancel
- oracle存储过程语句报错
- Oracle Directory Manager 服务未启动和运行
- 请问关于ORACLE中创建TYPE的用法,比如CREATE OR REPLACE TYPE type_str_split IS TABLE OF VARCHAR2 (4000)
- 请教高手
- oracle9i启动的问题。。。
- 我要卸载我的ora8i,可是我找不到地方呢?
- oracle 同一数据库、不同用户间、表操作的事务问题
- 最近考的一个题目,请大家讨论
- 有没有通过命令读取EXCEL表里的内容呢,像SQL SERVER 的OpenDataSource
- 请教语句!急
如果是前7天,应该是:
a.CREATE_date between (sysdate - 7 ,sysdate)
7天前则是:
a.CREATE_date = sysdate - 7
between (sysdate-7) and (sysdate)