关于分页的研究

//  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

你可能感兴趣的:(分页)