Sqlserver2008和Oracle分页语句

SqlServer 分页语句

select StuID ,StuNo,StuName,Age,Sex, ClassName ClassName from
(select *, row_number() over (order by StuID asc) as number from StudentInfo) t ,
ClassInfo c where t.ClassID = c.ClassID and t.number between @startindex and @endindex

表1==ClassInfo
表2==StudentInfo

变量:@startindex 和 @endindex


Oracle 分页语句

select * from (select id, name,
producttype, price, picture, isout, mark,
adddate,rownum rn from products) temp
where temp.rn>=:startIndex and temp.rn<=:endIndex

表==Products

posted @ 2016-03-22 19:19  李文平  阅读(143)  评论(0编辑  收藏  举报