title: TERADATA: SQL recursive query that selects from a recursive query
body: <p>I am trying to perform recursion multiple times using Teradata
  my query is similar to the following, upon referencing the query_1 from query_2 and trying to run it gives an error saying that query_1 doesn't exist.</p>
  
  <blockquote>
  <pre><code>WITH 
  RECURSIVE query_1
  AS (
   --some recursive query
  )
     ,RECURSIVE query_2
     AS (
     --another recursive query based on results from query_1
     )
  SELECT *
  FROM query_2
  </code></pre>
  </blockquote>
  
  <p>I want to concatenate values from different levels of hierarchy
  so I want to turn</p>
  
  <pre><code>------------------------------------
   trx    indx1   indx2   val
  ------------------------------------
   x1      1       1       a
   x1      1       2       b
   x1      1       3       c
   x1      2       1       d
  ...................................
  -----------------------------------
  </code></pre>
  
  <p>Into the following</p>
  
  <pre><code>----------------
   trx        val
  ----------------
   x1       a/b/c/d
  </code></pre>