Re: [sqlite] "where not exists (union-select)" fails on 2nd where

2005-08-24 Thread Markus Weissmann
On 24.08.2005, at 03:21, Kurt Welgehausen wrote: SELECT * FROM PRIM AS P WHERE NOT EXISTS ( SELECT REFID FROM REF1 WHERE REF1.REFID=P.ID UNION SELECT REFID FROM REF2 WHERE REF2.REFID=P.ID ); I looks like correct SQL according to the SQLite docs, but I don't understand why you coded the select

Re: [sqlite] "where not exists (union-select)" fails on 2nd where

2005-08-23 Thread Kurt Welgehausen
> SELECT * FROM PRIM AS P > WHERE NOT EXISTS > ( > SELECT REFID FROM REF1 WHERE REF1.REFID=P.ID > UNION > SELECT REFID FROM REF2 WHERE REF2.REFID=P.ID > ); I looks like correct SQL according to the SQLite docs, but I don't understand why you coded the select that way. You should get the same resul

[sqlite] "where not exists (union-select)" fails on 2nd where

2005-08-23 Thread Markus Weissmann
Hi folks, I've got a little problem with a - at least I think so - correct SQL- statement: three tables, two referencing the 1st one --- SELECT * FROM PRIM AS P WHERE NOT EXISTS ( SELECT REFID FROM REF1 WHERE REF1.REFID=P.ID UNION SELECT REFID FROM REF2 WHERE REF2.REFID=P.ID ); --- chokes wi