//本题考察流程函数 case when 条件1 then 成立1 when 条件2 then 成立2 ... else 前面都不成立,这个成立 end; 如果想要对,就要严格按格式来,end是必不可少的,否则会报错 select device_id, gender, case when(age<20) then('20岁以下') when(age<25) then('20-24岁') when(age>=25) then('25岁及以上') else('其他') end age_cut from user_profile;