 <p>You could just simplify your query to:</p> <pre><code>WITH MyQueryAlias1 AS (30 minutes sql query here) SELECT q1.field1 FROM MyQueryAlias1 q1 JOIN MyQueryAlias1 q2 ON q1.field2 = q2.field3 </code></pre> <p>Which will get rid of the second sub-query factoring clause.</p> <p>This might also work:</p> <pre><code>WITH MyQueryAlias1 AS (30 minutes sql query here) SELECT field1 FROM MyQueryAlias1 WHERE LEVEL = 1 AND ( field2 = field3 OR CONNECT_BY_ISLEAF = 0 ) CONNECT BY NOCYCLE PRIOR field2 = field3 AND LEVEL = 2; </code></pre>