On Monday, 11 March, 2019 09:42, heribert <herib...@scharnagl.com> wrote:

>it works perfect - but i do not understand why.

See https://sqlite.org/lang_with.html for a description of recursive queries ...


>The 'inital-select' results with the head node - only one result set.

>SELECT *
>   FROM Tree
>   WHERE ParentIDX = (SELECT ParentIDX
>                      FROM Tree
>                      WHERE ID = 3)
>     AND PrevIDX IS NULL
>
>Points SiblingsOf3 after your 'initial-select' to this head node?
>
>Why (and how) iterates your 'recursive-select'?
>
>SELECT Tree.*
>FROM Tree
>JOIN SiblingsOf3 ON SiblingsOf3.NextIDX = Tree.ID

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to