(text/x-fossil-wiki)
SELECT statements in a compound SELECT other than the right-most SELECT are
unable to use common table expressions. Example:
<blockquote><verbatim>
WITH RECURSIVE
t1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM t1 WHERE x<20),
t2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM t2 WHERE y<20)
SELECT x FROM t1 EXCEPT SELECT y FROM t2 ORDER BY 1;
</verbatim></blockquote>
The query above is suppose to return all even integers less than 20 that are
not divisible by 3. But instead we get a message: "no such table: t1".
|