Back
WITH y AS ( WITH x AS ( SELECT * FROM MyTable ) SELECT * FROM x)SELECT * FROM y
WITH y AS (
WITH x AS (
SELECT * FROM MyTable
)
SELECT * FROM x
SELECT * FROM y
Does something like this work? I tried it earlier but I couldn't get it to work.
Try using common table expressions to reuse previous queries in subsequent ones. You need the form of the statement like this:
WITH x AS ( SELECT * FROM MyTable), y AS ( SELECT * FROM x)SELECT * FROM y
WITH x AS
(
),
y AS
31k questions
32.8k answers
501 comments
693 users