Both work for me, Kit solution is very fast, but I think John is right. In my case, the tables have sequencial rowid. If I delete some row, then will not work anymore.
On Wed, Aug 19, 2009 at 12:44 PM, John Machin <sjmac...@lexicon.net> wrote: > On 20/08/2009 12:57 AM, Kit wrote: > > Right form (tested): > > > > SELECT petr4.data AS data,petr4.preult AS preult,temp.data AS > > previous_data,temp.preult AS previous_preult > > FROM petr4,petr4 AS temp > > WHERE petr4.rowid=temp.rowid+1; > > Don't you think that relying on (a) rowid being consecutive (b) rowid > order being identical to date order is just a little bit dodgy? What if > the table has been created by a bulk load, not necessarily in ascending > date order? What if some rows have been deleted? > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users