不同的DB的分页方式存在差异, https://en.wikipedia.org/wiki/Select_(SQL)#FETCH_FIRST_clause https://stackoverflow.com/questions/67036621/oracle-dialect-for-pagination https://stackoverflow.com/questions/1528604/how-universal-is-the-limit-statement-in-sql/24046664#24046664 另外JPA的Pageable是支持Oracle的,但有时需要设置方言: 针对错误:java.sql.SQLSyntaxErrorException: ORA-00933: SQL 命令未正确结束 因为oracle不支持limit的用法,需要在application.properties增加以下配置 #hibernate数据库方言配置: #org.hibernate.dialect.Oracle9iDialect,org.hibernate.dialect.Oracle10gDialect,org.hibernate.dialect.Oracle12cDialect; 10、11都使用org.hibernate.dialect.Oracle10gDialect 12使用org.hibernate.dialect.Oracle12cDialect spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle12cDialect 增加配置后,输出的sql为:select X from X where X fetch first ? rows only;