select &enter,
case
when enter=mon then '1'
when enter=yr then '12'
else '0'
end as status
from dual
答案 0 :(得分:1)
基于原始代码:
select '&enter',
case
when '&enter'='mon' then '1'
when '&enter'='yr' then '12'
else '0'
end as status
from dual
建议代码:
select '&enter',
case '&enter'
when 'mon' then 1
when 'yr' then 12
else 0
end as status
from dual