按照楼主的意思,该表中应该只会保留一笔记录,那么每次进行的插入操作,都可以改为UPDATE操作,然后在BEFORE UDPATE触发器中对新的check_count值与原有的check_count进行比较,决定是否进行更改。

解决方案 »

  1.   

    Lastdrop(空杯) 说得对!
    我同意!
      

  2.   

    create or replace function get_fun(p_check_count number) return number 
    is
    v_check_count number;
    begin
    select check_count into v_check_countfrom table_name;
    if v_check_count>p_check_count then
    return(p_check_count);
    else
    return(v_check_count);
    end if;
    end;
    /update table_name set check_count=get_fun(值);
    用函数作判断,不使用到触发器.
    该函数还没测试,试着用吧.