当前位置:网站首页>用户考试分数大于单科科目平均分的查询
用户考试分数大于单科科目平均分的查询
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
边栏推荐
- What is CRM Decision Analysis Management?
- [Office] Collection of Microsoft Office download addresses (offline installation and download of Microsoft's official original version)
- Can MySQL use aggregate functions without GROUP BY?
- 【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
- MySQL data view
- static linking and dynamic linking
- 第五章:多线程通信—wait和notify
- 哪位大佬有20年4月或者1月的11G GI和ojvm补丁呀,帮忙发下?
- Keil升级到AC6后,到底有哪些变化?
- ffmpeg drawtext 添加文本水印
猜你喜欢
项目成本控制如何帮助项目成功?
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
【AGC】增长服务1-远程配置示例
Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
基于MindSpore高效完成图像分割,实现Dice!
Data Middle Office Construction (10): Data Security Management
2022 Huashu Cup Mathematical Modeling Question A Optimization Design Ideas for Ring Oscillators Code Sharing
2022华数杯数学建模A题环形振荡器的优化设计思路思路代码分享
[强网杯2022]WP-UM
The JVM collection that Alibaba's top architects have summarized for many years, where can't I check it!
随机推荐
力扣(LeetCode)216. 组合总和 III(2022.08.04)
第七章,activiti个人任务分配,动态指定和监听器指定任务委派人「建议收藏」
Brief Analysis of WSGI Protocol
七夕浪漫约会不加班,RPA机器人帮你搞定工作
C语言的高级用法
5.部署web项目到云服务器
为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
一个栈的输入序列为1 2 3 4 5 的出站顺序的理解
three.js调试工具dat.gui使用
The JVM collection that Alibaba's top architects have summarized for many years, where can't I check it!
什么是CRM决策分析管理?
MySQL事务
Pycharm 常用外部工具
正则表达式replaceFirst()方法具有什么功能呢?
开源一夏|OpenHarmony如何查询设备类型(eTS)
js hijacks the array push method
three.js debugging tool dat.gui use
Getting started with Polkadot parachain development, this article is enough
韦东山 数码相框 项目学习(六)tslib的移植
这份阿里强推的并发编程知识点笔记,将是你拿大厂offer的突破口