Skip to content

Recursive Query with cycles #1798

Closed Answered by beikov
RaulPampliegaMayoral asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there. One way to avoid cycles is to check in the recursive part of your query whether the path already contains the current element i.e. where path not like concat('%', label, '/%'). I think it should also be possible to use union instead of union all to avoid duplicates.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RaulPampliegaMayoral
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants