[comp.databases] Oracle sqlplus problem

rs@mhuxu.UUCP (Bob Sanderman) (05/13/89)

I would like to generate an Oracle report using sqlplus that has line
numbers associated with each row returned.  What I did was something
like:

	select rownum, field
	from   table

This works fine.  However, if I add an order by clause that changes the
order of the rows, the row numbers get all messed up since they are
assigned before the sort is done.

How can the row numbers be generated correctly when an order by is used?

Thanks
Bob Sanderman
att!mhuxu!rs