sql case when then ...虚心求教select case salarywhen 5000 then '高薪'when 4500 then '中薪'when 3500 then '中低薪'else 'null'end as '工资等级' from telenolist我想统计各个工资级别的人数 那个count(*)应该放在语句的哪
来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 03:06:02
sql case when then ...虚心求教select case salarywhen 5000 then '高薪'when 4500 then '中薪'when 3500 then '中低薪'else 'null'end as '工资等级' from telenolist我想统计各个工资级别的人数 那个count(*)应该放在语句的哪
sql case when then ...虚心求教
select
case salary
when 5000 then '高薪'
when 4500 then '中薪'
when 3500 then '中低薪'
else 'null'
end as '工资等级'
from telenolist
我想统计各个工资级别的人数 那个count(*)应该放在语句的哪里,还用再填写别的语句吗?.
sql case when then ...虚心求教select case salarywhen 5000 then '高薪'when 4500 then '中薪'when 3500 then '中低薪'else 'null'end as '工资等级' from telenolist我想统计各个工资级别的人数 那个count(*)应该放在语句的哪
select
count(*) as cnt,
case salary
when 5000 then '高薪'
when 4500 then '中薪'
when 3500 then '中低薪'
else 'null'
end as '工资等级'
from telenolist
group by case salary
when 5000 then '高薪'
when 4500 then '中薪'
when 3500 then '中低薪'
else 'null'
end