Re: [sqlite] appending the output of a query

2014-12-02 Thread Igor Tandetnik
On 12/2/2014 2:46 PM, Paul Sanderson wrote: So what I really need is to a) ensure that the ordering of the recursive query is guranteed, i.e. the order follows the ID/parent relationship to the root b) a method of concatenating this in reverse order WITH RECURSIVE rcte AS ( SELECT 0 as

Re: [sqlite] appending the output of a query

2014-12-02 Thread Paul Sanderson
Hm thanks - actually thinking about it sorting by ID doesn't work as it is quite likely that the folder order doesn't follow the id/parent order, i.e. a parent folder could have an ID greater than one or more of its children. So what I really need is to a) ensure that the ordering of the

Re: [sqlite] appending the output of a query

2014-12-02 Thread Igor Tandetnik
On 12/2/2014 1:47 PM, Paul Sanderson wrote: WITH RECURSIVE rcte AS (SELECT rtable.ID, rtable.parent, rtable.FileName FROM rtable WHERE rtable.ID = 510 UNION ALL SELECT rtable.ID, rtable.parent, rtable.FileName FROM rcte INNER JOIN

Re: [sqlite] appending the output of a query

2014-12-02 Thread Paul Sanderson
Thanks Richard That helps but it seems I over simplified in order to get the help I thought I needed :) My actual query follows a MFT entry from an NTFS file system as such WITH RECURSIVE rcte AS (SELECT rtable.ID, rtable.parent, rtable.FileName FROM rtable WHERE rtable.ID =

Re: [sqlite] appending the output of a query

2014-12-02 Thread John McKown
On Tue, Dec 2, 2014 at 11:51 AM, Richard Hipp wrote: > On Tue, Dec 2, 2014 at 12:46 PM, Paul Sanderson < > sandersonforens...@gmail.com> wrote: > > > I have a query that returns one column but a number of rows so for > instance > > > > SELECT name from tab > > > > might return >

Re: [sqlite] appending the output of a query

2014-12-02 Thread Richard Hipp
On Tue, Dec 2, 2014 at 12:46 PM, Paul Sanderson < sandersonforens...@gmail.com> wrote: > I have a query that returns one column but a number of rows so for instance > > SELECT name from tab > > might return > > a > b > c > d > > I would like to append these terms and get a single line/string > >