当前位置:网站首页>用户考试分数大于单科科目平均分的查询
用户考试分数大于单科科目平均分的查询
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
边栏推荐
- 攻防世界-PWN-new_easypwn
- The founder of the DFINITY Foundation talks about the ups and downs of the bear market, and where should DeFi projects go?
- three objects are arranged in a spherical shape around the circumference
- ffmpeg drawtext 添加文本水印
- ffmpeg drawtext add text watermark
- 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
- 第五章:redis持久化,包括rdb和aof两种方式[通俗易懂]
- What is CRM Decision Analysis Management?
- 自定义过滤器和拦截器实现ThreadLocal线程封闭
- 力扣(LeetCode)216. 组合总和 III(2022.08.04)
猜你喜欢
【MindSpore易点通机器人-01】你也许见过很多知识问答机器人,但这个有点不一样
Complete image segmentation efficiently based on MindSpore and realize Dice!
three.js debugging tool dat.gui use
How can project cost control help project success?
气象数据数据处理实例——matlab字符串切割匹配与R语言日期匹配(数据拼接)
egg框架使用(二)
IDEA执行Test操作导致数据插入时出现了重复数据
2022华数杯数学建模A题环形振荡器的优化设计思路思路代码分享
开源一夏|OpenHarmony如何查询设备类型(eTS)
NowCoderTOP35-40 - continuous update ing
随机推荐
华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)
我们的Web3创业项目,黄了
第三章 : redis数据结构种类
three.js调试工具dat.gui使用
第五章:多线程通信—wait和notify
语音社交软件开发——充分发挥其价值
IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
一个栈的输入序列为1 2 3 4 5 的出站顺序的理解
【AGC】增长服务1-远程配置示例
第九章:activit内置用户组设计与组任务分配和IdentityService接口的使用
How does the official account operate and maintain?Public account operation and maintenance professional team
Why are RELTABLESPACE values 0 for many tables displayed in sys_class?
egg框架使用(一)
入门 Polkadot 平行链开发,看这一篇就够了
hcip BGP 增强实验
Imitation SBUS fixed with serial data conversion
Pycharm 常用外部工具
MySQL transactions
SD NAND Flash简介!
matcher中find,matches,lookingAt匹配字符串的不同之处说明