当前位置:网站首页>Database learning notes II
Database learning notes II
2022-06-26 07:53:00 【sunshine_ 0224】
Query statement expansion
limit Use (mysql Medium limit Be similar to sqlserver Medium top)
Use case table Student

The first one is :SELECT * FROM table LIMIT [offset,] rows
There are two parameters , First offset , from 0 At the beginning , The second parameter represents the number of rows .
select * from Student order by Stu_num asc limit 1,2
The result should be the red framed part

The second kind :SELECT * FROM table LIMIT rows OFFSET offset
select * from Student order by Stu_num asc limit 2 offset 1

group by And aggregate functions
1. In the use of GROUP BY When clause ,Select All columns in the list must be aggregate columns (SUM,MIN/MAX,AVG etc. ) or GROUP BY Columns included in clause . Again , If in SELECT Aggregate columns are used in the list ,SELECT The list must include only aggregate columns , Otherwise there must be one GROUP BY Clause .
2. Aggregate functions . Aggregate functions are used for GROUP BY Words and expressions , Used to aggregate grouped data . The aggregate function is in and GROUP BY Clause shows its powerful function . However, the use of aggregate functions is not limited to grouping queries ; If an aggregate function is used in the query statement , and No use GROUP BY Clause , The aggregate function is used to aggregate the entire result set ( matching WHERE Clause ). When not used GROUP BY When clause , stay SELECT Some aggregate functions in the list can only be used with other aggregate functions , That is, the aggregate function must use GROUP BY Clause can be used in SELECT Match the list with the list . for example , Don't use GROUP BY Clause ,SELECT In the list AVG And the only SUM Corresponding , But it cannot correspond to a specific column .
Be careful : in application , Aggregate functions are often combined with grouping functions group by Use a combination of
Common aggregate functions
边栏推荐
- [industry cloud talk live room] tomorrow afternoon! Focus on digital intelligence transformation of the park
- Area of Blue Bridge Cup 2 circle
- 记一次开发 pgadmin 时执行 Building the Web Assets 遇到的依赖安装问题
- PyTorch-12 GAN、WGAN
- Yyds dry inventory kubernetes easy service discovery and load balancing (11)
- [UVM basics] understanding of sequence and sequencer
- Solution to the problem of multi application routing using thinkphp6.0
- Apache inlong graduated as a top-level project with a million billion level data stream processing capability!
- ASP. Net and Net framework and C #
- Golang collaboration and channel usage
猜你喜欢
![[NLP] vector retrieval model landing: Bottleneck and solution!](/img/c4/784534e5504dfee1c989d19255c31b.jpg)
[NLP] vector retrieval model landing: Bottleneck and solution!

This article will take you to learn in detail what is FTTH

Median segmentation (find rules) - Niuke
![Jemter stress test - Basic request - [teaching]](/img/f4/36dbd80e89d96e1121a6e2b92d1d07.png)
Jemter stress test - Basic request - [teaching]

Livevideostackcon | evolution of streaming media distribution for online education business
![[UVM basics] TLM common data receiving and sending and data receiving examples](/img/4f/6c6e8b26124ba042f949291b944c3d.jpg)
[UVM basics] TLM common data receiving and sending and data receiving examples

Uniapp wechat withdrawal (packaged as app)

Opencv鼠标事件+界面交互之绘制矩形多边形选取感兴趣区域ROI

Teach you how to use the harmonyos local simulator

In interface testing, several methods to verify the success of deleting interfaces
随机推荐
2022 ranking of bank financial products
Redis (5) -- Talking about compressed list
Apache InLong毕业成为顶级项目,具备百万亿级数据流处理能力!
Use intent to shuttle between activities -- use implicit intent
Here is the command to display the disk space usage. Go ahead and pay attention to more wonderful things!
Yyds dry inventory kubernetes easy service discovery and load balancing (11)
Attention mechanism yyds, AI editor finally bid farewell to P and destroyed the whole picture
Niuniu looks at the cloud (greedy, hash, push formula) - the first session of Niuke winter vacation training camp
Go language custom DNS resolver practice yyds dry inventory
Encapsulating ranging and surface class based on leaflet
Tsinghua Yaoban chendanqi won Sloan award! He is a classmate with last year's winner Ma Tengyu. His doctoral thesis is one of the hottest in the past decade
Arrangement and insertion structure
Getdrawingcache of view is empty. Solution: interview questions for Android audio and video development
The first screen time, you said you optimized it, then you calculated it and showed it to me!
Minor problems in importing D
Summary of domestic database examination data (continuously updated)
[UVM practice] Chapter 2: a simple UVM verification platform (5) build test cases
JS event loop mechanism
What is Wi Fi 6 (802.11ax)? Why is Wi Fi 6 important?
Is it safe for individuals to buy stocks with compass software? How to buy stocks