一、if (被判断表达式,如果为真的取值,如果为假的取值);
二、case
目的:为了 根据已经存在的列,通过加减乘除运算或者赋值,得到新的列;
使用方法:分为等值判断 和 区间判断;
1.等值判断
case 变量、列
when 常量值1 then 常量1
when 常量值2 then 常量2
else 其他
end zhang;
2.区间判断
case
when 变量 >2000 then 常量1
when 变量 >1500 then 常量2
else 其他
end zhang;