Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying of maximal depth for recursive CTE [CORE1290] #1711

Open
firebird-automations opened this issue May 31, 2007 · 4 comments
Open

Specifying of maximal depth for recursive CTE [CORE1290] #1711

firebird-automations opened this issue May 31, 2007 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alexander Tyutik (tut)

Votes: 7

It would be nice to enhance syntax of recursive CTE to something like this:

WITH [RECURSIVE [MAX DEEP X]]

Because now we do not have any effective solution for limitation such recursive queries by deep.

@firebird-automations
Copy link
Collaborator Author

Commented by: @tonal

My bee better construct with explicit recursive exit condition.
Like this:

WITH [RECURSIVE [WHERE <condition>]]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12240 ] => Firebird [ 15588 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

summary: Specifying of maximal deep for recursive CTE => Specifying of maximal depth for recursive CTE

@firebird-automations
Copy link
Collaborator Author

Commented by: Michał Ziemski (r_o_o_k)

Wouldn't this be sufficient:

WITH RECURSIVE
S AS (SELECT 0 DEPTH, ID
FROM TMP
UNION ALL
SELECT S.DEPTH + 1, http://TMP.ID
FROM TMP
JOIN S ON TMP.PARENT_ID = http://S.ID
WHERE S.DEPTH < 10)
SELECT * FROM S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant