你打个 list
   查看你的SQL语句,用符号 / 执行上一次操作,

解决方案 »

  1.   

    没有可能cjsj不能同时大于一个时间并小于另一个时间啊
    请高手指点一下会是什么地方出错了?
      

  2.   

    或者在SQL》提示符下 输入 RUN
      

  3.   

    show error提示没有错误。
    但是run的时候提示ERROR:ORA-01756: 括号内的字符串没有正确结束
      

  4.   

    1* select last_value(bj_zxyg) over()-first_value(bj_zxyg) over() bj_zxyg,last_value(bj_fxyg) over(请大家帮忙看一下,我不太清楚括号里面哪里出错了?而且如果有错的话,应该不加最后一个条件的时候也会有错啊?
      

  5.   

    select last_value(bj_zxyg) over()-first_value(bj_zxyg) over() bj_zxyg,last_value(bj_fxyg) over()-first_value(bj_fxyg) over() bj_fxyg,bl from table1 where dybm=1 and fl=0 and bj=1 and (cjsj>=to_date('2003-4-1 00:00:00','yyyy-mm-dd hh24:mi:ss')
    and cjsj<=to_date('2003-4-30 23:59:59','yyyy-mm-dd hh24:mi:ss'))

    select last_value(bj_zxyg) over()-first_value(bj_zxyg) over() bj_zxyg,last_value(bj_fxyg) over()-first_value(bj_fxyg) over() bj_fxyg,bl from table1 where dybm=1 and fl=0 and bj=1 and (cjsj between to_date('2003-4-1 00:00:00','yyyy-mm-dd hh24:mi:ss') and =to_date('2003-4-30 23:59:59','yyyy-mm-dd hh24:mi:ss'))
      

  6.   

    to wl3721()兄:不行,我已经加过括号了,还是没有结果
      

  7.   

    我试了一下,好像就是无法实现cjsj大于一个时间而小于一个时间:
    SQL> select distinct last_value(bj_zxyg) over()-first_value(bj_zxyg) over() bj_zxyg,last_value(bj_fxyg) over()-first_value(bj_fxyg) over() bj_fxyg,bl from table1 where cjsj>=to_date('2003-4-1 00:00:00','yyyy-mm-dd hh24:mi:ss') and cjsj<=to_date('2003-4-30 23:59:59','yyyy-mm-dd hh24:mi:ss');
      2  
    SQL> run
      1* select distinct last_value(bj_zxyg) over()-first_value(bj_zxyg) over() bj_zxyg,last_value(bj_fx
    ERROR:
    ORA-01756: 括号内的字符串没有正确结束只要不用cjsj>=...and cjsj<=...,就可以出来结果
    请问高手这是怎么回事?有解决的办法吗?
      

  8.   

    只要去掉cjsj的任何一个限制条件,就有结果显示出来