Hi Darren,

If that works, then try using a subquery in the view definition instead.

 create view Enumerated
 as
 select rowid as Sequence, Name from (
   select Name from Planets order by Name
 )

Sort of like that.

Thanks for the suggestion, but, unless I'm missing something, it doesn't work. Since rowid doesn't exist in the inner query, the outer query assigns Sequence with a null value, so the whole result is:

Sequence    Name
----------  ----------
.           Earth
.           Jupiter
.           Mars
.           Mercury
.           Venus

(. = null)

If we instead change it to include rowid in the subquery:

create view Enumerated
as
select rowid as Sequence, Name from (
   select rowid, Name from Planets order by Name
)
;

we get the original rowids (but we instead want a numerical sequence 1, 2, 3, 4, 5):

Sequence    Name
----------  ----------
3           Earth
5           Jupiter
4           Mars
1           Mercury
2           Venus

Thanks,
Tom


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

Reply via email to