-- 分页 limit 起始值,页面大小
-- 每页5条数据
SELECT * FROM STUDENT ORDER BY SID LIMIT 0,5 -- 第一页
SELECT * FROM STUDENT ORDER BY SID LIMIT 5,5 -- 第二页
#SELECT * FROM STUDENT ORDER BY SID LIMIT (N-1)*页面大小,页面大小 -- 第N页
-- 查找math成绩前三名且成绩大于70的学生学号姓名和math成绩从高到低
SELECT student.sid,NAME,math FROM student AS student JOIN score AS score WHERE student.sid=score.sid AND score.math >70 ORDER BY math DESC LIMIT 0,3