首页 > 数据库技术 > 详细

分页的SQL语句

时间:2015-10-08 16:29:49      阅读:335      评论:0      收藏:0      [点我收藏+]
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 title desc ) as pagenum  
 from share  where title like ‘%奖%‘order by title ) t 
 where t.pagenum  between 5 and 1*10 order by id

 

(2) 分页

 select top 20 * from share where id not in
(select top  10 id from share  order by id) order by id

 

分页的SQL语句

原文:http://www.cnblogs.com/sulong/p/4861155.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!