资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

█████分页问题!急!ORACLE里面是这样写的!SQLSERVER2000里面怎么写!!!在线等!█████

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

ORACLE里面是这样写的!SQLSERVER2000里面怎么写!急!希望能给改改!谢谢  
  public   String   intiQuerySQL(String   sql,   int   startIndex,   int   size)   {  
  StringBuffer   querySQL   =   new   StringBuffer();  
  if   (size   !=   Page.MAX_PAGE_SIZE)   {  
  querySQL.append("select   *   from   (select   my_table.*,rownum   as   my_rownum   from(")  
  .append(sql)  
  .append(")   my_table   where   rownum<")  
  .append(startIndex   +   size)  
  .append(")   where   my_rownum>=")  
  .append(startIndex);  
  }   else   {  
  querySQL.append("select   *   from   (select   my_table.*,rownum   as   my_rownum   from(")  
  .append(sql)  
  .append(")   my_table   ")  
  .append(")   where   my_rownum>=")  
  .append(startIndex);  
  }  
  return   querySQL.toString();  
  }  
 

网友回答:

发表者:michaelyf

在sqlserver中使用TOP   rownum就可以实现


 

 
热门推荐笔记本: 三星笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved