If we use VACUUM command will it reassign a new ROWID to each rows and write it in the ascending order of ROWID? If yes then that is what Pramoda.M.A needed.
On 5/15/09, John Machin <sjmac...@lexicon.net> wrote: > On 15/05/2009 8:41 PM, Pramoda M. A wrote: >> But how to get the rows in the same order of insertion? >> Say, I will insert 2 3 4 and it will store in 2 4 3. But I need in the >> order 2 3 4. Is it possible? > > Possibility (1): Unless you use INTEGER PRIMARY KEY and supply your own > values for the key column, the ROWID pseudocolumn will be automatically > given values in ascending sequence. Then you can do queries like: > > SELECT * FROM your_table ORDER BY ROWID; > > Possibility (2): Have a column named e.g. when_created and populate it > with CURRENT_TIMESTAMP either implicitly using a DEFAULT column > constraint in CREATE TABLE, or explicitly when you INSERT. Note: the > precision of the clock (1 second) may not be enough; you may wish to use > ROWID as a tie-breaker in your ORDER BY clause. > > ... *but* why do you want to recover stuff in insertion order? > > HTH, > > John > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Regards Rajesh Nair _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users