Are you sure this is true? The rowid in the source table has no relationship to the order of the results of the query.
> -----Original Message----- > From: Jay Sprenkle [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 19, 2005 9:21 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] How to get row numbers in a query? > > > Is there any way to SELECT out the row number of returned > results in a > > query? > > For example: > > > > SELECT row_number(), value from some_table; > > 1 ValueA > > 2 ValueB > > 3 ValueC > > ... etc ... ?? > > > > What I really want this for is a query where I am inserting > from table A > > into table B, and table B has a column which stores the > order the new rows > > are inserted. So I need a statement like: > > You can use rowid. > > Insert into table B ( SortByColumn, Value ) > select rowid, value from table A > > Then > > Select value from B order by SortByColumn >