JPQL for select from select row_number() over()

前端 未结 2 1349
借酒劲吻你
借酒劲吻你 2021-01-19 02:02

I\'m using Db2 on AS/400, and I am trying to execute a JPQL query that will return results from row x to row y.

In SQL this works:

select cur.* from          


        
相关标签:
2条回答
  • 2021-01-19 02:06

    That cannot be done. JPQL operates to entities and entities are mapped to tables in database. Row number in db2 is concept in result set, not in database table.

    0 讨论(0)
  • 2021-01-19 02:07
    Query q = em.createQuery("select e from SomeEntity e")
                .setFirstResult(0)
                .setMaxResults(10);
    
    0 讨论(0)
提交回复
热议问题