1.OracleDB:
Sql:SELECT*FROMuserWHERErownum<=n;
Hql:fromUseruorderbyu.salarydescwhererownum<=n;
2.SQLServer:
Sql:SELECTTOPn*FROMuser;
3.MySQL:
Sql:SELECT*FROMTable1LIMITn
hibernate查询记录的前10条记录,Hql不支持limit
Hql:query.setFirstResult(0);//从第0条记录开始取
query.setMaxResults(10);//取10条记录