1. Standard (the end of a case is an end case, but the end can also be used. 2 is, but the end cannot be used directly in 1, and an error will be reported)
if tmpmoshiid is not null then CASE WHEN (main2.allcount<=100) THEN select t_0_100 into tmpkcbili from t_cl_moshi where id=tmpmoshiid; WHEN (main2.allcount<=1000) THEN select t_100_1000 into tmpkcbili from t_cl_moshi where id=tmpmoshiid; WHEN (main2.allcount<=5000) THEN select t_1000_5000 into tmpkcbili from t_cl_moshi where id=tmpmoshiid; WHEN (main2.allcount<=10000) THEN select t_5000_10000 into tmpkcbili from t_cl_moshi where id=tmpmoshiid; WHEN (main2.allcount<=20000) THEN select t_10000_20000 into tmpkcbili from t_cl_moshi where id=tmpmoshiid; ELSE tmpkcbili :=0; END case; select nvl(round(main2.allcount*tmpkcbili),0) into main2.kouchucnt from dual;end if;
2. End directly at the end. It should not work in theory, but this can be used.
if Dianxin_V_Num>0 then tmpmsglevel := CASE WHEN (Dianxin_V_Num<=10) THEN 5 WHEN (Dianxin_V_Num<=100) THEN 4 WHEN (Dianxin_V_Num<=500) THEN 3 WHEN (Dianxin_V_Num<=2000) THEN 2 WHEN (Dianxin_V_Num>2000) THEN 1 ELSE 3 END;end if;