Re: [sqlite] CTE to Get Path In a Tree

2019-05-14 Thread Bart Smissaert
> >-Original Message- > >From: sqlite-users [mailto:sqlite-users- > >boun...@mailinglists.sqlite.org] On Behalf Of Keith Medcalf > >Sent: Monday, 13 May, 2019 19:46 > >To: SQLite mailing list > >Subject: Re: [sqlite] CTE to Get Path In a Tree > > > > >

Re: [sqlite] CTE to Get Path In a Tree

2019-05-13 Thread Keith Medcalf
a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Keith Medcalf >Sent: Monday, 13 May, 2019 19:46 >To: SQLite mailing list >Subject: Re: [sqlit

Re: [sqlite] CTE to Get Path In a Tree

2019-05-13 Thread Keith Medcalf
but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Bart Smissaert >Sent: Monday, 13 May, 2019 15:22 >To: SQLite mailing list >Subject: Re: [sql

Re: [sqlite] CTE to Get Path In a Tree

2019-05-13 Thread Bart Smissaert
Have the same table structure to represent a folder tree: CREATE TABLE FOLDERS([ID] INTEGER PRIMARY KEY, [PARENT_ID] INTEGER, [NAME] TEXT, [LEVEL] INTEGER, [RANK] TEXT) Data is as follows: ID PARENT_ID NAME LEVEL RANK

Re: [sqlite] CTE to Get Path In a Tree

2019-05-12 Thread Philip Bennefall
On 5/12/2019 2:14 PM, Igor Tandetnik wrote: On 5/12/2019 6:19 AM, Philip Bennefall wrote: Hi everyone, I have a tree of folders and I want to find the complete path from any arbitrary point back to the top level directory. The schema is: CREATE TABLE IF NOT EXISTS folders( id INTEGER

Re: [sqlite] CTE to Get Path In a Tree

2019-05-12 Thread Igor Tandetnik
On 5/12/2019 6:19 AM, Philip Bennefall wrote: Hi everyone, I have a tree of folders and I want to find the complete path from any arbitrary point back to the top level directory. The schema is: CREATE TABLE IF NOT EXISTS folders(     id INTEGER PRIMARY KEY,     parentFolderId INTEGER

[sqlite] CTE to Get Path In a Tree

2019-05-12 Thread Philip Bennefall
Hi everyone, I have a tree of folders and I want to find the complete path from any arbitrary point back to the top level directory. The schema is: CREATE TABLE IF NOT EXISTS folders( id INTEGER PRIMARY KEY, parentFolderId INTEGER REFERENCES folders(id) ON DELETE CASCADE ON UPDATE