当前位置:网站首页>The query that the user's test score is greater than the average score of a single subject
The query that the user's test score is greater than the average score of a single subject
2022-08-05 10:17:00 【go and be safe~】
Such a situation is often encountered in life. For example, in the grades of the whole class, we want to count the situation that each student's single subject score is above the average score of the subject in the class, and display it..
The case is as follows:
After each exam, there will be a grade sheet, as follows:
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 |
Please write a sql statement to query the attributes of all grades whose user's score is greater than the average score of their job (job), and sort them in ascending order of id, as follows:
Incorrect spelling:
select g.id,g.job,g.score from grade g
left join
(select job,avg(score) as A from grade group by job) f
边栏推荐
- Confessing in the era of digital transformation: Mai Cong Software allows enterprises to use data in the easiest way
- mysql索引
- 【Office】Microsoft Office下载地址合集(微软官方原版离线安装下载)
- 阿里顶级架构师多年总结的JVM宝典,哪里不会查哪里!
- leetcode: 529. 扫雷游戏
- dotnet OpenXML parsing PPT charts Getting started with area charts
- What is the function of the regular expression replaceAll() method?
- 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
- 你最隐秘的性格在哪?
- 力扣(LeetCode)216. 组合总和 III(2022.08.04)
猜你喜欢
一文道清什么是SPL
C语言的高级用法
leetcode: 529. 扫雷游戏
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
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补丁呀,帮忙发下?
【温度预警程序de开发】事件驱动模型实例运用
High-quality DeFi application building guide to help developers enjoy DeFi Summer
STM32+ULN2003 drives 28BYJ4 stepper motor (forward and reverse according to the number of turns)
Open Source Summer | How OpenHarmony Query Device Type (eTS)
随机推荐
Analysis and practice of antjian webshell dynamic encrypted connection
MySQL之数据视图
第五章:redis持久化,包括rdb和aof两种方式[通俗易懂]
C语言的高级用法
正则表达式replaceFirst()方法具有什么功能呢?
JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number
阿里顶级架构师多年总结的JVM宝典,哪里不会查哪里!
PHP 操作mangoDb
【 temperature warning program DE development 】 event driven model instance
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
Oracle temporary table space role
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
ffmpeg drawtext 添加文本水印
Development common manual link sharing
How can project cost control help project success?
牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
【AGC】增长服务1-远程配置示例
浅析WSGI协议
多线程(进阶) - 2.5w字总结