Hi all,

When I create a table, SQLite enumerates the rows in the rowid column.

When I create a view, is there any way to enumerate the output rows?

For example, say I have a table:

create table Planets( Name text collate nocase );
insert into Planets values( 'Mercury' );
insert into Planets values( 'Venus' );
insert into Planets values( 'Earth' );
insert into Planets values( 'Mars' );
insert into Planets values( 'Jupiter' );

and I have a view that sorts them alphabetically:

create view as select Name from Planets order by Name;

which gives:

Earth
Jupiter
Mars
Mercury
Venus

How could I give those rows with enumeration:

1 Earth
2 Jupiter
3 Mars
4 Mercury
5 Venus

Note that the sort order may be more complex than this, or there may be a "where" filtering. But the result needs to simply number the rows from 1 to n.

Thanks,
Tom


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to