当前位置:网站首页>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
边栏推荐
- QSS 选择器
- js劫持数组push方法
- Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
- Which big guy has the 11G GI and ojvm patches in April or January 2020, please help?
- 第五章:activiti流程分流判断,判断走不同的任务节点
- Our Web3 Entrepreneurship Project, Yellow
- How does the official account operate and maintain?Public account operation and maintenance professional team
- MySQL事务
- 还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!
- 第三章 : redis数据结构种类
猜你喜欢
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
Getting started with Polkadot parachain development, this article is enough
Our Web3 Entrepreneurship Project, Yellow
蚁剑webshell动态加密连接分析与实践
【MindSpore易点通机器人-01】你也许见过很多知识问答机器人,但这个有点不一样
Egg framework usage (1)
STM32+ULN2003 drives 28BYJ4 stepper motor (forward and reverse according to the number of turns)
Keil升级到AC6后,到底有哪些变化?
Complete image segmentation efficiently based on MindSpore and realize Dice!
three.js调试工具dat.gui使用
随机推荐
创建一个 Dapp,为什么要选择波卡?
Four years of weight loss record
首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析
MySQL transactions
什么是CRM决策分析管理?
Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
百年北欧奢华家电品牌ASKO智能三温区酒柜臻献七夕,共品珍馐爱意
技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
Go编译原理系列6(类型检查)
leetcode: 529. Minesweeper Game
[Android]如何使用RecycleView in Kotlin project
Advanced usage of C language
[Office] Collection of Microsoft Office download addresses (offline installation and download of Microsoft's official original version)
Keil升级到AC6后,到底有哪些变化?
What is the function of the regular expression replaceAll() method?
Jenkins使用手册(2) —— 软件配置
DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从
偏向锁/轻量锁/重级锁锁锁更健康,上锁解锁到底是怎么完成实现的
[Strong Net Cup 2022] WP-UM
Wei Dongshan Digital Photo Frame Project Learning (6) Transplantation of tslib