Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14

ROWNUM to LIMIT

Applies to ❌ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

Old Oracle SQL statements may use ROWNUM filtering to paginate, as Oracle has introduced support for FETCH FIRST only in Oracle 12c.

This transformation allows for transforming some of these syntaxes to equivalent, standard syntax using window functions or FETCH FIRST:

-- Input
SELECT * FROM t WHERE rownum = 1
-- Output
SELECT * FROM t LIMIT 1

Example configuration

Settings settings = new Settings()
    .withTransformRownum(Transformation.WHEN_NEEDED);

References to this page

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo