Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

With Within With - forum topic by indexpert

$
0
0

Hi,
Just wanted to know that ' is it possible to use CTE(Common table expression) within  another CTE?
Ex:
With CTE1 (c1,c2) as (select c1,c2 from table1),
CTE2 (c1,c2,c3) as (select CTE1.c1, CTE1.c2, Table2.c3 from CTE1 left join TABLE2 on Table2.c1=CTE1.C1)
 
Select * from CTE2;
 
I know we can do the same using Volatile Table. But just wanted to know if upper code works?

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles