sql查询 ―― 分页

匿名 (未验证) 提交于 2019-12-02 23:51:01
-- 分页       -- limit       -- limit start count    (start 显示骑士值,单页数量)       select *from student where gender=1 limit 6,3;        -- 分页       -- 以3行为一页,分页       -- 第一页       select *from student limit 0,3;       -- 第二页       select *from student limit 3,3;       -- 第三页       select *from student limit 6,3;       -- 分页式   limit(第n页-1)*count ,count        -- 查询所有男性, 2个数据为一页,以年龄倒序       select *from student where gender=1 order by age desc limit 0,2;        --  limit 始终要在最后       --失败 select *from student where gender=1 limit 0,2 order by age desc ;       -- limit 不支持数学表达式       -- 失败 显示第三页  select *from student where gender=1 limit (3-1)*2,2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!