In the documentation for the WITH clause 
(http://www.sqlite.org/lang_with.html), under the "Controlling Depth-First 
Versus Breadth-First Search Of a Tree Using ORDER BY" section, there is a small 
error in the example given:

     WITH RECURSIVE
       under_alice(name,level) AS (
         VALUES('Alice',0)
         UNION ALL
         SELECT org.name, under_alice.level+1
Error->    FROM org JOIN under_alice ON org.name=under_alice.boss
          ORDER BY 2
       )
     SELECT substr('..........',1,level*3) || name FROM under_alice;

should be


     WITH RECURSIVE

       under_alice(name,level) AS (

         VALUES('Alice',0)

         UNION ALL

         SELECT org.name, under_alice.level+1

Fix->      FROM org JOIN under_alice ON under_alice.name=org.boss

          ORDER BY 2

       )

     SELECT substr('..........',1,level*3) || name FROM under_alice;


After the fix is applied, the example gives the correct output as given in the 
documentation.

Thanks!

Brenna Hautzenroeder

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

Reply via email to