armok 版主
注册日期: 2002 Nov 来自: 广州 技术贴数:569 论坛积分:1894 论坛排名:915 论坛徽章:2
| 不用这么复杂啊。SQL里的确可以实现分页的。
我开发过一个论坛: www.oracle-dev.com , 是使用jsp+oracle, 就是使用这个方法。
有关的语句如下:
int bottom=(bbsPageNo-1)*pageLine; //bbsPageNo 为页码, pageLine为每页显示的数目 int top=bbsPageNo*pageLine+1; //bottom 为该页结束记录数,top 为该页起始记录数
String sql=" select * from (select rownum auto_id,locked,serial_no,content_str,deleted,parent_no,title,speaker,click_num,face,valued,translation,picture,creative,guide,movie,attop,if_newtopic,last_reply_time,to_char(last_reply_time,'mm-dd,hh24:mi') last_reply_time_str,last_reply_speaker,reply_count " +" from (select serial_no,locked,replace(replace(last_reply_content,'<br>',' '),'''','‘') content_str,deleted,parent_no,title,speaker,click_num,face,valued,translation,picture,creative,guide,movie ,attop,decode(sign(sysdate-issue_time-"+ newtopic_time/24 +"),-1,'y',null) if_newtopic,last_reply_time,reply_count ,last_reply_speaker " +" from "+topics_table+" order by attop,last_reply_time desc)) " +" where auto_id>"+bottom+" and auto_id<"+top;
__________________ 我的主页 http://61.144.28.248/dev 欢迎讨论developer开发问题
|