个性化阅读
专注于IT技术分析

Mariadb查询限制

点击下载

在MariaDB数据库中, SELECT语句与LIMIT子句一起使用可从表中检索一个或多个记录。

句法:

SELECT expressions
FROM tables
[WHERE conditions]
[ORDER BY expression [ ASC | DESC ]]
LIMIT row_count;

范例1:

以降序检索记录:

让我们在”学生”表中将SELECT语句与LIMIT子句一起使用。结果以降序显示, 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
赞(0)
未经允许不得转载:srcmini » Mariadb查询限制

评论 抢沙发

评论前必须登录!