<%
java.sql.Connection sqlCon;
java.sql.Statement sqlStmt;
java.sql.ResultSet sqlRst;
java.lang.String strCon;
java.lang.String strSQL;
int intPageSize;
int intRowCount;
int intPageCount;
int intPage;
java.lang.String strPage;
int i;
String news_id;
在oracle数据库中查询结果的行号使用伪列ROWNUM表示(从1开始)。例如select * from employee where rownum<10 返回前10条记录。但因为rownum是在查询之后排序之前赋值的,所以查询employee按birthday排序的第100到120条记录应该这么写:
select * from ( select my_table.*, rownum as my_rownum from ( select name, birthday from employee order by birthday ) my_table where rownum <120 ) where my_rownum>=100
mySQL可以使用LIMIT子句:
select name, birthday from employee order by birthday LIMIT 99,20
DB2有rownumber()函数用于获取当前行数。
SQL Server没研究过,可以参考这篇文章:http://www.csdn.net/develop/article/18/18627.shtm