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

考试分数(四)

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

知识点

  1. 首先按照岗位进行分组
  2. 然后进行计数,奇数如3除以2四舍五入就是2,3加1除以2也是2符合。偶数如4中位数就是2到3之间,按之前方法计算也符合

代码

select g.job, 
round(count(g.id)/2) as start, 
round((count(g.id)+1)/2) as end
from grade g
group by g.job
order by g.job
全部评论

相关推荐

09-17 10:53
四川大学 C++
牛客91242815...:会写标书没有任何卵用,鉴定为横向垃圾导师的受害者
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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