title: CTE in DB2 subquery
body: <p>I'm trying to use a recursive CTE in the from clause in DB2 luw 11.1. This CTE works by itself:</p>
  <pre><code>with i (i) as ( 
      values (1)
      union all 
      select i + 1 from i
      where i &lt; 3 
  ) 
  select * from i;
  
              I
  -------------
              1
              2
              3
  </code></pre>
  <p>But when I try it in the <code>from</code> clause:</p>
  <pre><code>select * 
  from (
      with i (i) as ( 
          values (1)
          union all 
          select i + 1 from i
          where i &lt; 3 
      )
      select * from i
  ) i;
  ERRO próximo da linha 1:
  SQL0104N  An unexpected token &quot;as&quot; was found following &quot;*
  from (
  with i (i)&quot;.  Expected tokens may include:  &quot;JOIN&quot;.
  </code></pre>
  <p>A similar construct works in Postgresql. What am I missing?</p>