本帖最后由 imxjs 于 2011-01-30 09:58:01 编辑

解决方案 »

  1.   

    用oracle的select语句就可以实现
    方法是
    select rest_id
    from table(你存这两个数据的表)
    which res_deal_sts = 'p';(p是啥意思 present?)
    这个是查询语句 也就是限制条件 如果是插入可以用merge实现 
      

  2.   

    构建另一张表,存入准备插入的数据
    然后用merge into
      

  3.   

    用个insert all搞定...给你个例子insert all
    when sal > 2000 then
    into insert_all_test1 values(no,name)
    when sal < 2500 then
    into insert_all_test2 values(no,sal)
    select empno no,ename name,sal from scott.emp;
      

  4.   

    if not exists(select 1 from tb where rest_id is null and rest_deal_sts = 'P' and 关键字 = ... and 日期 = ...)
       insert into tb(...) values(...)