Skip to content
Advertisement

UNION ALL query using WITH statement breaks

I wrote a query using with statement and union all. But, I am not used to writing complex queries. It keeps breaking in the union all. Please point me where it is wrong?

Error:

Reference t1 is not found.

Advertisement

Answer

Just out of curiosity. Is this what you need?

@KSp *I can see that you accepted this aswer, but if you want a recursive query, it should look more like (see answer and comments from @mathguy)

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement