当前位置:网站首页>用户考试分数大于单科科目平均分的查询
用户考试分数大于单科科目平均分的查询
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?
- MySQL data view
- NowCoderTOP35-40——持续更新ing
- Development common manual link sharing
- 项目成本控制如何帮助项目成功?
- IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
- 浅析WSGI协议
- Wei Dongshan Digital Photo Frame Project Learning (6) Transplantation of tslib
- Egg framework usage (2)
- 开源一夏|OpenHarmony如何查询设备类型(eTS)
猜你喜欢

NowCoderTOP35-40——持续更新ing

egg框架使用(一)

Bias lock/light lock/heavy lock lock is healthier. How is locking and unlocking accomplished?

一文道清什么是SPL

DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从

three objects are arranged in a spherical shape around the circumference

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

电竞、便捷、高效、安全,盘点OriginOS功能的关键词

Data Middle Office Construction (10): Data Security Management

Jenkins manual (2) - software configuration
随机推荐
韦东山 数码相框 项目学习(六)tslib的移植
js hijacks the array push method
dotnet OpenXML 解析 PPT 图表 面积图入门
七夕浪漫约会不加班,RPA机器人帮你搞定工作
leetcode: 529. 扫雷游戏
Is digital transformation a business buy-in?
Huawei's lightweight neural network architecture GhostNet has been upgraded again, and G-GhostNet (IJCV22) has shown its talents on the GPU
uniapp 连接ibeacon
matcher中find,matches,lookingAt匹配字符串的不同之处说明
入门 Polkadot 平行链开发,看这一篇就够了
19.服务器端会话技术Session
蚁剑webshell动态加密连接分析与实践
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
Can MySQL use aggregate functions without GROUP BY?
What is SPL?
牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02
NowCoderTOP35-40 - continuous update ing
技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
NowCoderTOP35-40——持续更新ing
2022华数杯数学建模思路分析交流