Available in versions: Dev (3.20) | Latest (3.19) | 3.18

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

Inline CTE

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

A few dialects do not support the WITH clause ("common table expressions", or CTEs). Others may have a limited implementation, where nesting of WITH clauses isn't supported.

This transformation allows for inlining non-recursive CTE to derived tables wherever they're referenced.

-- Input
WITH t (x) AS (SELECT 1) SELECT x FROM t
-- Output
SELECT x FROM (SELECT 1) AS t (x)

Example configuration

Settings settings = new Settings()
    .setTransformInlineCTE(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