当前位置:网站首页>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条记录
边栏推荐
- The detailed page returns to the list and retains the original position of the scroll bar
- Pointer - character pointer
- Gartner发布2022-2023年八大网络安全趋势预测,零信任是起点,法规覆盖更广
- Leetcode 450 deleting nodes in a binary search tree
- cf:D. Insert a Progression【关于数组中的插入 + 绝对值的性质 + 贪心一头一尾最值】
- Natural language processing (NLP) - third party Library (Toolkit):allenlp [library for building various NLP models; based on pytorch]
- Anconda download + add Tsinghua +tensorflow installation +no module named 'tensorflow' +kernelrestart: restart failed, kernel restart failed
- Leetcode 44 Wildcard matching (2022.02.13)
- 免费的聊天机器人API
- 图解网络:TCP三次握手背后的原理,为啥两次握手不可以?
猜你喜欢

数据分析思维分析方法和业务知识——分析方法(三)

The inconsistency between the versions of dynamic library and static library will lead to bugs
![[groovy] JSON serialization (convert class objects to JSON strings | convert using jsonbuilder | convert using jsonoutput | format JSON strings for output)](/img/52/021931181ad3f4bef271b4e98105c2.jpg)
[groovy] JSON serialization (convert class objects to JSON strings | convert using jsonbuilder | convert using jsonoutput | format JSON strings for output)

Spark AQE

Differences between standard library functions and operators

MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练

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

The population logic of the request to read product data on the sap Spartacus home page

Idea远程提交spark任务到yarn集群

【EI会议分享】2022年第三届智能制造与自动化前沿国际会议(CFIMA 2022)
随机推荐
新手入门深度学习 | 3-6:优化器optimizers
Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?
MIT doctoral thesis | robust and reliable intelligent system using neural symbol learning
Intranet Security Learning (V) -- domain horizontal: SPN & RDP & Cobalt strike
vSphere实现虚拟机迁移
《强化学习周刊》第52期:Depth-CUPRL、DistSPECTRL & Double Deep Q-Network
可恢复保险丝特性测试
Questions about database: (5) query the barcode, location and reader number of each book in the inventory table
Spark-SQL UDF函数
Pointer pointer array, array pointer
Spark获取DataFrame中列的方式--col,$,column,apply
Interview must brush algorithm top101 backtracking article top34
Zhuhai laboratory ventilation system construction and installation instructions
Classic CTF topic about FTP protocol
Leetcode Fibonacci sequence
Cve-2017-11882 reappearance
Power query data format conversion, Split Merge extraction, delete duplicates, delete errors, transpose and reverse, perspective and reverse perspective
The value of applet containers
Spark SQL UDF function
Reading notes of the beauty of programming