select if,,,,select case when then else end from

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 '优秀'

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;```

你可能感兴趣的:(select if,,,,select case when then else end from)