Looking backwards on the list one finds that:

There was a bug regarding compound SELECT statements 
that use CTEs discovered shortly after 3.8.3 was released:

   http://www.sqlite.org/src/info/67bfd59d9087a987
   http://www.sqlite.org/src/info/31a19d11b97088296a

The fix appeared in 3.8.4. If you upgrade, the statement will work.

Since you do not mention what version you are using, one assumes it is prior to 
this fix?

>-----Original Message-----
>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] On Behalf Of Frank Millman
>Sent: Monday, 25 August, 2014 04:11
>To: sqlite-users@sqlite.org
>Subject: [sqlite] Problem with recursive CTE
>
>Hi all
>
>According to the documentation for the WITH clause, "the recursive table
>must appear exactly once in the FROM clause of the recursive-select and
>must
>not appear anywhere else in either the initial-select or the
>recursive-select, including subqueries".
>
>I am trying to do the following -
>
>WITH RECURSIVE temp AS (
>  [initial-select UNION ALL recursive-select]
>  )
>SELECT * FROM temp UNION * FROM temp
>
>Obviously this is a simplification, but you get the idea.
>
>I get the error 'no such table: temp'.
>
>This query works with SQL Server and with PostgreSQL.
>
>Is this a limitation of sqlite3, or is there any workaround?
>
>Thanks
>
>Frank Millman
>
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



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

Reply via email to