On 6 May 2010 12:03, Matt Young <[email protected]> wrote: > # I am doing a simulation of distinct > > insert into seriesid (series_id,pointer) > select series_id,ROWID from seriesdata as s > where s.series_id not in( > select > series_id > from > seriesid > ); > > # compile the table seriesid, then in the subquery I interrodate the > table at its current state > # trying to include only members not already in. No run time erros. > > > Is this correct, shouyld this work?
No - the subquery is not reevaluated as each row is inserted into seriesid Put unique constraint on series_id in seriesid table, then use insert or ignore into seriesid select series_id, ROWID from seriesdata; Regards, Simon _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

