select e.salary, --case 语句开始 case when salary between 12000 and 15000 then salary + 6000 else salary end new_salary --case 语句结束,可见也和存储过程等结束方式一样用end关键字,且这个case语句的作用只是用来计算一个新的列 from t_employee e;
输出结果如下: