Reputation: 11514
I am trying to understand sql recursive statements, but it is really hard for me. For example:
Thats an exampe I am trying to understand and to write down the output.
Can sb pls explain me how this works, step by step?
greetings and thx in advance
maya
Upvotes: 5
Views: 1508
Reputation: 26464
The UNION ALL portion gets recursed until it returns no more records. I don't know if you can have multiple UNION ALL portions.
Upvotes: 0
Reputation: 34349
Also, see here - http://www.postgresql.org/docs/8.4/static/queries-with.html, where the steps of the recursive query evaluation are described.
Upvotes: 2