WITH y AS ( WITH x AS ( SELECT * FROM MyTable ) SELECT * FROM x ) SELECT * FROM y
Does something like this work? I tried it ear
we can create nested cte.please see the below cte in example
;with cte_data as ( Select * from [HumanResources].[Department] ),cte_data1 as ( Select * from [HumanResources].[Department] ) select * from cte_data,cte_data1