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

考试分数(四)

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
全部评论

相关推荐

不愿透露姓名的神秘牛友
今天 13:35
点赞 评论 收藏
分享
06-07 17:17
嘉兴学院 教师
单单人旁的佳:你是我见过最美的牛客女孩
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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