当前位置:网站首页>Basic knowledge of mysql (2)
Basic knowledge of mysql (2)
2022-07-31 04:01:00 【shortage--】
1. Sorting rules
Use ORDER BY clause to sort
ASC (ascend): ascending order
DESC (descend): descending order
ORDER BY clause in SELECTthe end of the statement.
We can use column aliases to sortSELECT employee_id,salary,salary * 12 annual_salFROM employeesORDER BY annual_sal;#Note: Column aliases can only be used in ORDER BY, not in WHERE.#The following operation reports an error!SELECT employee_id,salary,salary * 12 annual_salFROM employeesWHERE annual_sal > 81600;Second, paging
LIMIT is used in MySQL to implement paging
Format: LIMIT [position offset,] number of rows
#Requirement: display pageSize records per page,The pageNo page is displayed:
#Formula:
SELECT * FROM table LIMIT(PageNo - 1)*PageSize,PageSize;
Note: The LIMIT clause must be placed at the end of the entire SELECT statement!
The benefits of using LIMIT
Constraining the number of returned results can reduce the network traffic of the data table and improve query efficiency.
If we know that there is only one result returned, we can use LIMIT 1 to tell the SELECT language
边栏推荐
- What is a system?
- "DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction" paper notes
- Component pass value provide/inject
- A brief introduction to the showDatePicker method of the basic components of Flutter
- (线段树) 基础线段树常见问题总结
- Redis counts new and retained users
- LocalDate addition and subtraction operations and comparison size
- C语言从入门到如土——数据的存储
- The els block moves the boundary to the right, and accelerates downward.
- [C language] Preprocessing operation
猜你喜欢

浅识Flutter 基本组件之showDatePicker方法

With 7 years of experience, how can functional test engineers improve their abilities step by step?

Win10 CUDA CUDNN 安装配置(torch paddlepaddle)

(八)Math 类、Arrays 类、System类、Biglnteger 和 BigDecimal 类、日期类

Safety 20220712
![[C language] General method of expression evaluation](/img/59/cf43b7dd16c203b4f31c1591615955.jpg)
[C language] General method of expression evaluation

VS QT - ui does not display newly added members (controls) || code is silent

The BP neural network

Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea

高等数学---第九章二重积分
随机推荐
[Paper reading] Mastering the game of Go with deep neural networks and tree search
Web container and IIS --- Middleware penetration method 1
5. How does the SAP ABAP OData service support the $filter operation
Smartcom Programming Level 4 - Magic Academy Lesson 6
$attrs/$listeners
Redis counts new and retained users
Summary of Huawei Distributed Storage FusionStorage Knowledge Points [Interview]
C language from entry to such as soil, the data store
SIP Protocol Standard and Implementation Mechanism
Golang中的addressable
日志级别 和 打印log注意
高等数学---第九章二重积分
【AUTOSAR-RTE】-5-Explicit(显式)和Implicit(隐式) Sender-Receiver communication
LocalDate加减操作及比较大小
[CV project debugging] CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT problem
three.js 制作3D相册
els 方块向左移动条件判断
组件传值 provide/inject
Safety 20220712
SQL Interview Questions (Key Points)