If you have some test data I'll happily do that one. Meanwhile here is
something similar, using the test data from the SQLite CTE page.
orgchart
name | boss
-------------
Alice |
Bob | Alice
Cindy | Alice
Dave | Bob
Emma | Bob
Fred | Cindy
Gail | Cindy
ua := {{ name:= 'Alice', level := 0 }}
recurse({{ boss := name, level := level+1 }}
compose orgchart)
ua [{ t:=fill('.', level*3) & name }]
t
----------
Alice
...Bob
...Cindy
......Dave
......Emma
......Fred
......Gail
Regards
David M Bennett FACS
Andl - A New Database Language - andl.org
-----Original Message-----
From: [email protected]
[mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of Petite
Abeille
Sent: Monday, 15 June 2015 1:56 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] User-defined types -- in Andl
> On Jun 14, 2015, at 4:01 PM, david at andl.org wrote:
>
> First, I added a RECURSE() function to Andl, similar to the CTE in SQLite.
Nice.
> The Mandelbrot algorithm looks like this.
Could we see something more, hmmm, pedestrian? Perhaps a simple recursive
query, showing, say, all the managers of an employee given the following
structure: create table employee( id integer not null, manager_id integer,
constraint employee_pk primary key( id ), constraint employee_manager_fk
foreign key( manager_id ) references employee( id ) )
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users