那是用case when then else end写,不是用if else写,语句:
select case when c = 1 then 0 when d = 1 then 1 when e = 1 then 2 else null
from table
那是用case when then else end写,不是用if else写,语句:
select case when c = 1 then 0 when d = 1 then 1 when e = 1 then 2 else null
from table