Case When Condition Condition 1 then 2 then the value 1 when the value 2 the else Value. 3 End
After the then (can, but to be consistent numeric or string type and so on) when the field value is then conditional statements.
1. Simple case function
case sex when '1' then '男' when '2' then '女’ else '其他' end
2.case search functions
case when sex = '1' then ' M' 8 when sex = '2' then ' F' 9 else 'other' end