急求数据库查询语句 运行通过给分
表 employee的两个属性 name和salary
name
John
Franklin
Joyce
Ramesh
James
Jennifer
Ahmad
Alicia
salary
30000
40000
25000
38000
55000
43000
25000
25000
我们将员工的工资水平分为三类,即工资小于30000为低工资,工资大于等于30000且小于50000为中等工资,工资大于等于50000为高工资。请显示所有员工的姓名及其对应的工资水平。
[解决办法]
select
name,
case when salary <3000 then '低工资 ' when salary > =50000 then '高工资 ' else '中等工资 ' end
from employee
[解决办法]
select name , 工资水平 = case when salary < 3000 then '低工资 '
when salary > = 3000 and salary < 5000 then '中等工资 '
when salary > = 3000 then '高工资 '
from tb
[解决办法]
select name , 工资水平 = case when salary < 3000 then '低工资 '
when salary > = 3000 and salary < 5000 then '中等工资 '
when salary > = 3000 then '高工资 '
end
from employee
[解决办法]
select
name,
case when salary <3000 then '低工资 '
when salary > =50000 then '高工资 '
else '中等工资 ' end
from employee
[解决办法]
Select [name],Case When salary <3000 Then '低工资 ' When salary > =50000 Then '高工资 ' Else '中等工资 ' End 工资水平 From employee Order By 工资水平
我的异常网推荐解决方案:软件开发者薪资,http://www.myexception.cn/other/1391128.html