> 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