mysql、sqlserver、db2、oracle、hsql数据库获取数据库连接方法及分页函数

转自:http://www.2cto.com/database/201312/262775.html


sql分页查询:

//oracle

select * from (select rownum rm, * from tableName where rownum<(startRow+rowNum)) where rm>=startRow;

//mysql

select * from tableName limit startRow , rowNum ;

//sqlserver

select top (startRow + rowNmu) from tableName ;

//db2

select * from tableName limit startRow , rowNum ;

//hsql

select limit startRow rowNum * from (select * from tableName) ;


你可能感兴趣的:(sql查询,Java技术)