我想问下,oracle的存储过程中,能否在IF条件中,多写几个条件?类似JAVA那样 if(a==2 || a==2....)这样。因为我有一个存储过程要写IF,可以有很多个如果,但是就执行2种结果。我不想写很多if then elsif这样。请问可以吗?谢了~~

解决方案 »

  1.   

    of course.If a=1 or a=2 thenelsif elseend if;
      

  2.   

    可以这么写
    if (a<>1 or b<> 2 or c<> 3) and n>0 then 
    elsif n>0 
    then
    else
    end if;
      

  3.   

    if (a<>1 or b<> 2 or c<> 3) and n>0 then  
    elsif n>0  
    then
    else
    end if;
      

  4.   

    if a=2 or b=3 ... then
    end if;
      

  5.   

    可以这样写吗?IF a=b or d=e THEN
        .......
    ELSIF c=g or f=k THEN
        .......
    END IF这样写可以吗?