当前位置:网站首页>MYSQL---查询成绩为前5名的学生
MYSQL---查询成绩为前5名的学生
2022-07-06 00:52:00 【晚风吹儿】
需求:查询成绩为前5名的学生
拿到需求后,先对需求进行分析,找出筛选的条件
一、Mysql查询
1、最基本的查询
select * from table where name="panpan"
2、查前5名
在mysql中筛选数据的前几名,可以用关键字:limit
select * from table where name="panpan" limit 1
说明:查询表中名为panpan的第一条记录
3、以什么条件进行筛选,需求是以成绩进行筛选,则可以用order by 排序筛选
select * from table where order by grade
二、查询应用
合并后查询:
select * from score order by grade limit 5
说明:查询到score表里的grade ,以grade筛选,提取出前5条记录
边栏推荐
- Cve-2017-11882 reappearance
- Anconda download + add Tsinghua +tensorflow installation +no module named 'tensorflow' +kernelrestart: restart failed, kernel restart failed
- KDD 2022 | 脑电AI助力癫痫疾病诊断
- The relationship between FPGA internal hardware structure and code
- [groovy] compile time metaprogramming (compile time method interception | find the method to be intercepted in the myasttransformation visit method)
- MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练
- Construction plan of Zhuhai food physical and chemical testing laboratory
- The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea
- 《强化学习周刊》第52期:Depth-CUPRL、DistSPECTRL & Double Deep Q-Network
- Why can't mathematics give machine consciousness
猜你喜欢
Cf:c. the third problem
After Luke zettlemoyer, head of meta AI Seattle research | trillion parameters, will the large model continue to grow?
The relationship between FPGA internal hardware structure and code
Anconda download + add Tsinghua +tensorflow installation +no module named 'tensorflow' +kernelrestart: restart failed, kernel restart failed
Intranet Security Learning (V) -- domain horizontal: SPN & RDP & Cobalt strike
vSphere实现虚拟机迁移
Common API classes and exception systems
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
Recoverable fuse characteristic test
esxi的安装和使用
随机推荐
Starting from 1.5, build a micro Service Framework - call chain tracking traceid
Leetcode 450 deleting nodes in a binary search tree
测试/开发程序员的成长路线,全局思考问题的问题......
[groovy] JSON serialization (jsonbuilder builder | generates JSON string with root node name | generates JSON string without root node name)
Overview of Zhuhai purification laboratory construction details
Power Query数据格式的转换、拆分合并提取、删除重复项、删除错误、转置与反转、透视和逆透视
Leetcode:20220213 week race (less bugs, top 10% 555)
直播系统代码,自定义软键盘样式:字母、数字、标点三种切换
激动人心,2022开放原子全球开源峰会报名火热开启
RAID disk redundancy queue
Idea远程提交spark任务到yarn集群
China Taiwan strategy - Chapter 8: digital marketing assisted by China Taiwan
Dynamic programming -- linear DP
The detailed page returns to the list and retains the original position of the scroll bar
面试必刷算法TOP101之回溯篇 TOP34
NLP basic task word segmentation third party Library: ICTCLAS [the third party library with the highest accuracy of Chinese word segmentation] [Chinese Academy of Sciences] [charge]
The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea
I'm interested in watching Tiktok live beyond concert
SAP Spartacus home 页面读取 product 数据的请求的 population 逻辑
猿桌派第三季开播在即,打开出海浪潮下的开发者新视野