mysql数据库中case when适合多条件查询的情况一般用法包含两种方式:
1.select id,name,
case
when score>=90 then '优秀'
when score<90 and score>=85 then '良好'
when score<85 and score>=60 then '合格'
else '不合格' end as level from student
2 select id,name,
case
when type ='1 ' then '合格'
else '不合格' end as level from student