select
case when &value >=1 then 1 else 0 end as a,
case when &value >=2 then a + 2 else 0 end as b,
case when &value >=3 then b + 3 else 0 end as c
from dual
select
case when &value >=1 then 1 else 0 end as a,
case when &value >=2 then case when &value >=1 then 1 else 0 end + 2 else 0 end as b,
case when &value >=3 then case when &value >=2 then case when &value >=1 then 1 else 0 end + 2 else 0 end + 3 else 0 end as c
from dual
------其他解决方案--------------------
select
case when &value <=1 then 1 else 0 end as a,
case when &value <=2 AND &VALUE>1 then 3 WHEN &value <=1 THEN 2 else 0 end as b,
case when &value <=3 AND &VALUE>2 then 6 when &VALUE>1 then 5 WHEN &value <=1 THEN 4 ELSE 0 end as c
from dual