题解 | #考试分数(四)#
考试分数(四)
https://www.nowcoder.com/practice/502fb6e2b1ad4e56aa2e0dd90c6edf3c?tpId=82&tags=&title=&difficulty=0&judgeStatus=0&rp=1&sourceUrl=%2Fexam%2Foj%3Fpage%3D2%26tab%3DSQL%25E7%25AF%2587%26topicId%3D82
select job,cast(count(id)/2 as unsigned integer),round((count(id)+1)/2,0) from grade group by job
order by job
- cast(x as type):类型转换
- round(x,y):四舍五入
- floor(x):向下取整
- ceil(x)/ceiling(x):向上取整
SQL题解 文章被收录于专栏
主要是为自己做个笔记