zoukankan      html  css  js  c++  java
  • Mysql---9 分页和排序

    1.分页  limit  offset 和排序 order by   desc  降序  asc 升序

      select  a.1,2,3,4 from a

           inner join b

            on a.1=b.1

               inner join c

                on c.2=b.2  

                    where 3='xxx'

                     order by 4 desc (asc);

    2.分页是所有select where条件的最后一项; limit  起始值,行数   

        limit    (n-1)*pageSize  ,pageSize      页数=数据总数/pageSize   ---pageSize 页面大小;

          

    select  a.1,2,3,4 from a

           inner join b

            on a.1=b.1

               inner join c

                on c.2=b.2  

                    where 3='xxx'

                     order by 4 desc (asc)  

                      limit 0,10;

  • 相关阅读:
    leetcode 414
    Leetcode 495
    Leetcode 485题
    Python 24点(2)
    python 24点
    我的第一次作业
    Django
    multiprocessing模块
    遍历文档树
    shutil模块
  • 原文地址:https://www.cnblogs.com/chencn/p/12303392.html
Copyright © 2011-2022 走看看