关于分页的研究

//  sql = "select top " + pagesize + " cid,applicationCode,username,telephone,projName,loanPrice,createDate from BocCoupons where cid not in ( select top " + (page - 1) * pagesize + "cid from BocCoupons where "
                        + "isDel=0 and audit=0 order by createDate " + order + ") and isDel=0 and city='" + city + "' and audit=0 order by createDate " + order;
//分页第一页
select top 10 cid,applicationCode,username,telephone,projName,loanPrice,createDate from BocCoupons where cid not in ( select top 0 cid from BocCoupons where isDel=0 and audit=0 order by createDate desc) and isDel=0  and audit=0 order by createDate desc
//分页第二页
select top 10 cid,applicationCode,username,telephone,projName,loanPrice,createDate from BocCoupons where cid not in ( select top 10 cid from BocCoupons where isDel=0 and audit=0 order by createDate desc) and isDel=0  and audit=0 order by createDate desc

posted @ 2010-10-19 15:51  老皆知  阅读(204)  评论(0编辑  收藏  举报