oracle存储过程里的ifelse语句这样写,想想也是醉了

oracle存储过程里的ifelse语句这样写,想想也是醉了

 if dwxh = 1 then
          num1 := num_sum;
        elsif dwxh = 2 then
          num2 := num_sum;
        elsif dwxh = 3 then
          num3 := num_sum;
        elsif dwxh = 4 then
          num4 := num_sum;
        elsif dwxh = 5 then
          num5 := num_sum;
        elsif dwxh = 6 then
          num6 := num_sum;
        elsif dwxh = 7 then
          num7 := num_sum;
        elsif dwxh = 8 then
          num8 := num_sum;
        elsif dwxh = 9 then
          num9 := num_sum;
        end if;

之前每个都写
else if …..then

end if;
就报错呵呵呵呵~~

你可能感兴趣的:(ORACLE)