> Example:
>
>
> CREATE TABLE aaa (i, seqnr);
> INSERT INTO "aaa" VALUES(10,NULL);
> INSERT INTO "aaa" VALUES(20,NULL);
> INSERT INTO "aaa" VALUES(50,NULL);
> INSERT INTO "aaa" VALUES(30,NULL);
> INSERT INTO "aaa" VALUES(20,NULL);
>
> UPDATE aaa  SET seqnr=(SELECT count() FROM aaa smaller where
> smaller.rowid <= aaa.rowid);
>
> select * from aaa;
> i|seqnr
> 10|1
> 20|2
> 50|3
> 30|4
> 20|5
>
>
> Regards
>
> Rob Golsteijn

In my opinion, the dispenser (the code that generates the insert commands) is 
the one that should be assigning the sequence numbers. It is this code only 
that knows which goes first, especially if we are talking about multithreaded 
computation. ROWID is "order as inserted by SQLite" not "order as inserted by 
dispenser". Order in which SQLite inserts is important for SQLite and its 
developers.

Roman

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to