当前位置:网站首页>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条记录
边栏推荐
- 2020.2.13
- Reading notes of the beauty of programming
- Ubantu check cudnn and CUDA versions
- STM32 key chattering elimination - entry state machine thinking
- 云导DNS和知识科普以及课堂笔记
- Overview of Zhuhai purification laboratory construction details
- 猿桌派第三季开播在即,打开出海浪潮下的开发者新视野
- [groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
- Natural language processing (NLP) - third party Library (Toolkit):allenlp [library for building various NLP models; based on pytorch]
- 激动人心,2022开放原子全球开源峰会报名火热开启
猜你喜欢

Common API classes and exception systems

Study diary: February 13, 2022

免费的聊天机器人API

Fibonacci number

Free chat robot API

Four dimensional matrix, flip (including mirror image), rotation, world coordinates and local coordinates

Arduino hexapod robot

MCU通过UART实现OTA在线升级流程

Cannot resolve symbol error
![[EI conference sharing] the Third International Conference on intelligent manufacturing and automation frontier in 2022 (cfima 2022)](/img/39/9d189a18f3f75110b400506e274391.png)
[EI conference sharing] the Third International Conference on intelligent manufacturing and automation frontier in 2022 (cfima 2022)
随机推荐
免费的聊天机器人API
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
[groovy] compile time metaprogramming (compile time method injection | method injection using buildfromspec, buildfromstring, buildfromcode)
MYSQL GROUP_ The concat function realizes the content merging of the same ID
For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
Fibonacci number
Common API classes and exception systems
Extension and application of timestamp
Lone brave man
图解网络:TCP三次握手背后的原理,为啥两次握手不可以?
可恢复保险丝特性测试
如何制作自己的機器人
Curlpost PHP
[groovy] compile time metaprogramming (compile time method interception | find the method to be intercepted in the myasttransformation visit method)
Differences between standard library functions and operators
MySQL storage engine
Cve-2017-11882 reappearance
数据分析思维分析方法和业务知识——分析方法(三)
C language programming (Chapter 6 functions)
ubantu 查看cudnn和cuda的版本