case when then 中的条件里面加上 and or 的处理方式 写法1: case when (u.sex <> 1 and u.sex <> 2) then 1 else 0 end 写法2,去掉括号: case when u.sex <> 1 and u.sex <> 2 then 1 else 0 end