用 sysdate - 1 试试

解决方案 »

  1.   

    谢谢大家回复.
    我维护的是一家国有大企业的数据库.是ORA8I
    每天都要提取前一天的业务发展量,因为产品很多所以要涉及到很多表.很多SQL
    每天都要改SQL里面的时间,取表都得3.4个小时.工作效率上不去
    有哪位高手能帮我,写条SQL 取每天的增量,而不需修改时间.谢谢
      

  2.   

    试验把你每天的工作变成存储过程,在建立个job,在存储过程中建立日志,也就是建立一个日志表
    在存储过程正确运行正确后,在日志表中插入条记录记录运行完成时间,
    这样你每天的工作就是看看这张表,不过小心下岗了:)
      

  3.   

    jxc(GameHeart) 老兄sysdate - 1在SQL 最后怎么定义,怎么写  我做了执行不了啊  非常感激
      

  4.   

    zzhtd(华子) 老凶
    我实在是个菜鸟 撒都不晓得 你帮我写个你所说的过程过程好不 我宁愿那样下岗 实在着不住了比如这个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
    group by b.bureau_no 能加个命令调出前天的增量也好 谢谢了
      

  5.   

    我觉得有个办法,赫赫~~:
    select * from table where 你的原来的固定的手工改的日期;
    把你上面的部分改为:
    select * from table where timeField = sysdate - 1;
      

  6.   

    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 a.CREATE_date>=to_date('2005-05-31 00:00:00','yyyy-mm-dd hh24:mi:ss')
    and a.CREATE_date<to_date('2005-06-01 23:59:59','yyyy-mm-dd hh24:mi:ss')
    group by b.bureau_no修改后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 a.CREATE_date = sysdate - 1
    group by b.bureau_no  可以执行,但返回为空,查询系统时间正确.请各位大哥指点
      

  7.   

    谢谢各位大哥 当日的已经好了  分也给你们了 真的很感激但是sysdate  -  7;  怎么就数据不准了如果取前7天的  改怎么定义  谢谢了