plsql存储过程中的条件判断

2025-03-22 16:51:09
推荐回答(2个)
回答1:

这样写就行了。如果比是1,2,3,就return返回。
if product_type not in (1, 2, 3) then
return;
end if;
如果product_type是字符串变量:
if product_type not in ('1', '2', '3') then
return;
end if;

回答2:

if product_type = 1 or product_type = 2 or product_type = 3 then
--要执行的代码

else

end if;