Just to nitpick :
SQLite version 3.16.0 2016-11-04 19:09:39
Enter ".help" for usage hints.
Connected to a transient in-memory database.
sqlite> with recursive count_down(v) as (
...> select 5
...> union all
...> select n - 1 from count_down where n > 0
...> )
...>
R Smith-2 wrote
> The query above is perfectly defined. In fact, it works in PostgreSQL.
> PostgreSQL's manual also has a very nice explanation of how recursive
> queries are evaluated.
The way PostgreSQL handles recursive queries was one of my motivations to
post about this.
PostgreSQL allows
R Smith-2 wrote
> The query above is perfectly defined. In fact, it works in PostgreSQL.
> PostgreSQL's manual also has a very nice explanation of how recursive
> queries are evaluated.
The way PostgreSQL handles recursive queries was one of my motivations to
post about this.
PostgreSQL allows
On 2018/07/19 10:23 PM, Lifepillar wrote:
On 19/07/2018 15:53, R Smith wrote:
In your example above, the full recursive set is not known at the
time of first encountering the sub-query.
i.e. do you expect it to have results on the first iteration?
The query above is perfectly defined. In
On 19/07/2018 15:53, R Smith wrote:
On 2018/07/19 2:32 PM, Christian Duta wrote:
WITH RECURSIVE
count_down(v) AS (
SELECT 5
UNION ALL
SELECT cd.v - 1
FROM (
SELECT cd.v
FROM count_down AS cd
) AS cd
WHERE cd.v > 0
)
SELECT * FROM count_down;
Error:
On 2018/07/19 2:32 PM, Christian Duta wrote:
WITH RECURSIVE
count_down(v) AS (
SELECT 5
UNION ALL
SELECT cd.v - 1
FROM (
SELECT cd.v
FROM count_down AS cd
) AS cd
WHERE cd.v > 0
)
SELECT * FROM count_down;
Error: near line 1: recursive reference in a
Hello,
when writing a recursive queries, I encountered the following error:
[...] recursive reference in a subquery: [...]
The following minimal example illustrates when this error occurs:
WITH RECURSIVE
count_down(v) AS (
SELECT 5
UNION ALL
SELECT cd.v - 1
FROM (
7 matches
Mail list logo