select if,,,,select case when then else end from
select if(sal>3000,CONCAT(ename,'工資太高了'),CONCAT(ename,'正常')) from emp;
select
CASE
when chengji>=90 then '優(yōu)秀'
when chengji between 70 and 89 then '良好'
when chengji between 60 and 69 then '及格'
else '不及格'
END as 成績
from xuesheng;
------------------------------------------------------------------------------------
select
ename,
CASE
when sal>=3000 then '富裕'
when sal between 2000 and 2999 then '小康'
when sal between 1000 and 1999 then '溫飽'
else '貧困'
END as 生活水平
from emp;```