zoukankan      html  css  js  c++  java
  • 分页的SQL语句

    share 表的字段id, title, image, content, wx_cont_url, jump_url, fx_suc, hits, add_date, class_id, faburen_id, reg_time, news_author, news_src 

    (1)分页

     select * from ( select  top 100 percent * ,row_number() over (order by id ) as pagenum  
     from share  where title like '%奖%'order by id ) t where t.pagenum  between 10 and 20 order by id--页码超出返回空

    (2) 分页

    select top 10 * from  share where id in ( select top (2*10) id from share where title like '%奖%' order by id) order by id desc --总是得到10条,页码超出返回最后的10条
  • 相关阅读:
    3
    2
    1
    11
    12
    8888888888
    99999999999
    88888888888
    77777777
    10.23
  • 原文地址:https://www.cnblogs.com/sulong/p/4861155.html
Copyright © 2011-2022 走看看