当前位置:网站首页>用户考试分数大于单科科目平均分的查询
用户考试分数大于单科科目平均分的查询
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
边栏推荐
- Complete image segmentation efficiently based on MindSpore and realize Dice!
- 韦东山 数码相框 项目学习(六)tslib的移植
- Offensive World-PWN-new_easypwn
- 为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
- Handwriting Currying - toString Comprehension
- SD NAND Flash简介!
- leetcode: 529. 扫雷游戏
- 第七章,activiti个人任务分配,动态指定和监听器指定任务委派人「建议收藏」
- SMB + SMB2: Accessing shares return an error after prolonged idle period
- 【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
猜你喜欢

Open Source Summer | How OpenHarmony Query Device Type (eTS)

Which big guy has the 11G GI and ojvm patches in April or January 2020, please help?

茄子科技CEO仇俊:以用户为中心,做用户真正需要的产品

JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number

告白数字化转型时代:麦聪软件以最简单的方式让企业把数据用起来

C语言的高级用法

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

Oracle临时表空间作用

High-quality DeFi application building guide to help developers enjoy DeFi Summer

STM32+ULN2003驱动28BYJ4步进电机(根据圈数正转、反转)
随机推荐
第四章:redis 数组结构的set和一些通用命令「建议收藏」
力扣(LeetCode)216. 组合总和 III(2022.08.04)
Getting started with Polkadot parachain development, this article is enough
第五章:activiti流程分流判断,判断走不同的任务节点
Can MySQL use aggregate functions without GROUP BY?
IDEA执行Test操作导致数据插入时出现了重复数据
教你本地编译运行一个IDEA插件,在IDEA里聊天、下棋、斗地主!
Why are RELTABLESPACE values 0 for many tables displayed in sys_class?
Advanced usage of C language
EU | Horizon 2020 ENSEMBLE: D2.13 SOTIF Safety Concept (Part 2)
How does the official account operate and maintain?Public account operation and maintenance professional team
第八章:activiti多用户任务分配
[强网杯2022]WP-UM
[Office] Collection of Microsoft Office download addresses (offline installation and download of Microsoft's official original version)
JS逆向入门学习之回收商网,手机号码简易加密解析
Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
js hijacks the array push method
技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
three物体围绕一周呈球形排列
IDEA performs the Test operation, resulting in duplicate data when data is inserted