请教MySQL中case when的用法

create table test201606 (
affaircode nvarchar(50),
timelimit int,
reserved5 int
)

insert into test201606 select 'sbz002','0','1'
insert into test201606 select 'sbz017','0','0'
insert into test201606 select 'sbz032','30','0'

select affaircode,
case timelimit
when 0 and reserved5=1 then '电子即办'
when 0 and reserved5=0 then '普通即办'
else '流转' end as 类型
from test201606

感觉到目前为止都是没有错误的,但是运行结果sbz002和sbz017都是‘电子即办’,请问select语句中哪里有错了?求指导。

1。
select name, case when birthday'1981' then 'old' when birthday>'1988' then 'yong' else 'ok' END YORN from lee;

2。
select NAME, case name when 'sam' then......
答案就在这里:MYSQL -- case when用法
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

timelimit int,可是你插入的是字符串类型,这个本身就不对,而且0 and reserved5=1这个表达式和 0 and reserved5=0,都恒为0,如果你希望判断条件
timelimit = 0 and reserved5=1,你得用if,不能这么写。