Consider the following table definitions:

DROP TABLE IF EXISTS flightplans;


CREATE TABLE flightplans (

    id text NOT NULL,

    ident text,

    recvd integer,

    orig text,

    dest text,

    PRIMARY KEY (id)

);



DROP TABLE IF EXISTS inflight;


CREATE TABLE inflight (

    fp text,

ident text,

    alt integer,

    clock integer NOT NULL DEFAULT 0,

    gs integer,

    heading integer,

    lat real,

    lon real,

    reg text,

squawk int,

primary key (fp)

);


It is an error to select a column that doesn?t exist?


sqlite> select fp from flightplans;

Error: no such column: fp

But if I select a column that doesn?t exist within an embedded subquery, it is 
not an error?


sqlite> delete from inflight where fp in (select fp from flightplans);

sqlite>

(In the above example, unless I am mistaken, it should produce more or less the 
same ?no such column? error.)

In my ?real life? version of this stuff where it has a fair number of rows in 
the tables, it appears to be an infinite loop, like with < 100K rows in each 
table I aborted the statement after more than 20 minutes of CPU time.


Reply via email to