题解 | #考试分数(四)#

考试分数(四)

http://www.nowcoder.com/practice/502fb6e2b1ad4e56aa2e0dd90c6edf3c

【关键】关键是case when 函数的运用!
【代码如下】
select job,
case when count(score)%2=0 then floor(count(score)/2) else floor(count(score)/2)+1 end as start,
case when count(score)%2=0 then floor(count(score)/2)+1 else floor(count(score)/2)+1 end as end
from grade group by job
order by job

全部评论

相关推荐

买蜜雪也用卷:我觉得应该没有哪个人敢说自己熟练使用git,代码分支一复杂还是得慢慢寻思一下的,不过基本的拉代码提交代码还有分支什么的是应该会
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务