On 9 Mar 2018, at 4:09am, sanhua.zh <sanhua...@foxmail.com> wrote: > Here is the sample SQL I tried: > ``` > CREATE TABLE t(i INTEGER); > INSERT INTO t VALUES(1); > WITH cte AS(SELECT i FROM t) > UPDATE cte SET i = 0; // Failed with "Error: no such table: cte" > ``` > > > Note that the sample WITH CLAUSE make no sense. It's just for testing. But > still failed. > Did I use it in a wrong way? What's the suggesting rule?
The table called "cte" is not saved in the database. Think of it as like a temporary index used for an ORDER BY, and deleted immediately the statement ends. Therefore you cannot INSERT or DELETE into it either. You are expected to SELECT from it, not to modify it to change how the WITH command works. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users