sql - Using multiple CTEs in one statement -


i want use multiple ctes in query, haven't been able working. following example of do:

with tbl1     (select *     tblstuff)  tbl2     (select tbl1.fldstuff1 ...      tbl1, tblstuff2)      select *     tbl2 

with tbl1     (select *     tblstuff),  tbl2     (select tbl1.fldstuff1, tbl1.fldstuff2, tblstuff2.fldstuff1, tblstuff2.fldstuff2      tbl1, tblstuff2)      select *     tbl2 

when use multiple ctes, no need with, seperate comma.


Comments