Yes, the parent ID column (par) is available in both views - sqlite> select id, par, line from vtag; id par lev line 1 0 <parent1> 2 1 1 <leaf1> 3 1 1 <parent2> 4 3 2 <leaf2> 5 1 1 <parent3> 6 5 2 <parent4> 7 6 3 <leaf4> 8 5 2 <leaf3>
sqlite> select id, par, line from vparent_closetag; id par lev line 1 0 </parent1> 3 1 1 </parent2> 5 1 1 </parent3> 6 5 2 </parent4> I have tried many different UNION and WITH statements but I can't get the desired result - order level line 1 0 <parent1> 2 1 <leaf1> 3 1 <parent2> 4 2 <leaf2> 5 1 </parent2> 6 1 <parent3> 7 2 <parent4> 8 3 <leaf4> 9 2 </parent4> 10 2 <leaf3> 11 1 </parent3> 12 0 </parent1> Any help would be appreciated. On 26 November 2017 at 11:30, Clemens Ladisch <clem...@ladisch.de> wrote: > Simon Slavin wrote: > > On 26 Nov 2017, at 8:02am, Shane Dev <devshan...@gmail.com> wrote: > >> Any ideas to achieve this? > > > > Use the UNION keyword to combine the results of the two SELECT commands > > That would not order the close tags correctly. > > >> Any ideas to achieve this? > > Would it be possible to have parentid fields? > > <http://www.sqlite.org/lang_with.html#withorderby> > > > Regards, > Clemens > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users