if to_date(gettime,'yyyy-mm-dd hh24:mi')+2>sysdate then ...
else ...

解决方案 »

  1.   

    SQL> select * from test;GET_TIME   TIME_LIMIT
    ---------- ----------
    02-12月-03          2
    03-12月-03          2SQL> select decode(sign((get_time+2)-sysdate),1,'正常',0,'正常',-1,'超期') from
    test;DECO
    ----
    正常
    正常SQL> insert into test values(to_date('2003-12-01 12:10','yyyy-mm-dd hh24:mi'),'2
    ');已创建 1 行。SQL> select decode(sign((get_time+2)-sysdate),1,'正常',0,'正常',-1,'超期') from
    test;DECO
    ----
    正常
    正常
    超期
      

  2.   

    if select to_char(get_time,'yyyymmddhh24miss')+time_limit>sysdate