sql数据库
SELECT field1=
CASE A
WHEN '1' THEN 'A'
WHEN '2' THEN 'B'
WHEN '3' THEN 'C'
ELSE 'D'
END
FROM table
access:
SELECT SWITCH(A='1', 'A', A='2', 'B', A='3', 'C', true, 'D') AS field1 FROM table
iif用法
IIf(A,IIf(B,条件1,条件2),IIf(B,条件3,条件4))