posts - 0, comments - 77, trackbacks - 0, articles - 356
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

MS SQLServer 与 Oracle分页的sql语句

Posted on 2007-07-23 08:47 semovy 阅读(268) 评论(0)  编辑  收藏 所属分类: 数据库方面
select   *   from    
            (    
            select   top(pagesize)   *   from    
            (    
                      select   top   (pagesize   *   pageindex)   *    
                      from   articles    
                      order   by   id   desc    
            )    
            order   by   id   asc    
  )    
  order   by   id   desc    
   
  oracle:    
   
   
  select   *   from   (    
    select   rownum   num,t1.*    
      from   table   t1   where   fast=0    
  )   where   num>=intposition   and   num<=intendposition

只有注册用户登录后才能发表评论。


网站导航: