MariaDB教程

MatiaDB SELECT LIMIT

在MariaDB数据库中,SELECT语句与LIMIT子句一起使用以从表中检索一个或多个记录。
语法:
SELECT expressions
FROM tables
[WHERE conditions]
[ORDER BY expression [ ASC | DESC ]]
LIMIT row_count; 
示例1:
以降序检索记录:
让我们在"学生"中使用带有LIMIT子句的SELECT语句"表。结果以降序显示,LIMIT为4、
SELECT student_id, student_name, student_address
FROM Students
WHERE student_id <= 7
ORDER BY student_id DESC
LIMIT 4;
输出:
Mariadb选择限制1
示例2:
以升序检索记录:
SELECT student_id, student_name, student_address
FROM Students
WHERE student_id <= 7
ORDER BY student_id ASC
LIMIT 4;
输出:
Mariadb选择限制2
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4