当前位置:网站首页>用户考试分数大于单科科目平均分的查询
用户考试分数大于单科科目平均分的查询
2022-08-05 10:10:00 【且行且安~】
生活中常常会遇到这样的一种的情况,比如在全班的成绩中,我们想统计下,每位同学的单科成绩在班级中当科科目平均分以上的情况,进行展示。
案例如下:
每次考试完,都会有一个成绩表(grade),如下:
| id | job | score |
| 1 | C++ | 11001 |
| 2 | C++ | 10000 |
| 3 | C++ | 9000 |
| 4 | Java | 12000 |
| 5 | Java | 13000 |
| 6 | JS | 12000 |
| 7 | JS | 11000 |
| 8 | JS | 9999 |
| 9 | Java | 12500 |
请你写一个sql语句查询用户分数大于其所在工作(job)分数的平均分的所有grade的属性,并且以id的升序排序,如下:
错误的写法:
select g.id,g.job,g.score from grade g
left join
(select job,avg(score) as A from grade group by job) f
边栏推荐
- After Keil upgrades to AC6, what changes?
- 高质量 DeFi 应用构建指南,助力开发者玩转 DeFi Summer
- Keil升级到AC6后,到底有哪些变化?
- IDEA执行Test操作导致数据插入时出现了重复数据
- ffmpeg drawtext 添加文本水印
- Egg framework usage (1)
- Huawei's lightweight neural network architecture GhostNet has been upgraded again, and G-GhostNet (IJCV22) has shown its talents on the GPU
- 哪位大佬有20年4月或者1月的11G GI和ojvm补丁呀,帮忙发下?
- 【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
- NowCoderTOP35-40——持续更新ing
猜你喜欢

【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different

The technological achievements of Shanghai Konan were selected into the "2021 Shanghai Network Security Industry Innovation Research Achievement Catalog" by the Municipal Commission of Economy and Inf

IDEA performs the Test operation, resulting in duplicate data when data is inserted

Huawei's lightweight neural network architecture GhostNet has been upgraded again, and G-GhostNet (IJCV22) has shown its talents on the GPU

5.部署web项目到云服务器

高质量 DeFi 应用构建指南,助力开发者玩转 DeFi Summer

RT-Thread记录(一、RT-Thread 版本、RT-Thread Studio开发环境 及 配合CubeMX开发快速上手)

Technical dry goods | Hausdorff distance for image segmentation based on MindSpore

Analysis and practice of antjian webshell dynamic encrypted connection

技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
随机推荐
IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!
IDEA performs the Test operation, resulting in duplicate data when data is inserted
Bias lock/light lock/heavy lock lock is healthier. How is locking and unlocking accomplished?
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
第四章:redis 数组结构的set和一些通用命令「建议收藏」
皕杰报表的下拉框联动
The century-old Nordic luxury home appliance brand ASKO smart wine cabinet in the three-temperature area presents the Chinese Valentine’s Day, and tastes the love of the delicacy
js hijacks the array push method
Why are RELTABLESPACE values 0 for many tables displayed in sys_class?
【综合类型第 35 篇】程序员的七夕浪漫时刻
茄子科技CEO仇俊:以用户为中心,做用户真正需要的产品
Oracle temporary table space role
mysql索引
我们的Web3创业项目,黄了
[Office] Collection of Microsoft Office download addresses (offline installation and download of Microsoft's official original version)
第五章:activiti流程分流判断,判断走不同的任务节点
第三章 : redis数据结构种类
matcher中find,matches,lookingAt匹配字符串的不同之处说明
【AGC】增长服务1-远程配置示例