title: WITH CLAUSE in Netezza
body: <p>Unable to use JOIN inside the WITH CLAUSE</p>
  
  <pre><code>WITH EmpCTE(empid, empname, mgrid, lvl)
  AS
  ( 
    -- Anchor Member (AM)
    SELECT empid, empname, mgrid, 0
    FROM Employees
    WHERE empid = 7
    UNION ALL
  
    -- Recursive Member (RM)
    SELECT E.empid, E.empname, E.mgrid, M.lvl+1
    FROM Employees AS E
      JOIN EmpCTE AS M
        ON E.mgrid = M.empid
  )
  SELECT * FROM EmpCTE e order by e.empid  
  </code></pre>
  
  <blockquote>
    <p>ERROR [42S02] ERROR:  relation does not exist ADMIN.EMPCTE</p>
  </blockquote>
  
  <p>Can some one please give alternate Solutions ..thanks</p>