Record Counting

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hi all,

Got a little problem that I could do with some help with ..

I'm selecting from a table of data, the LAST 15 entries .. which is all fine
and dandy and works .. my Select query result will look something like this
(the data selected *could* change with extra entries) :

5 Last 15 Session Numbers session_id
8321
8298
8280
8265
8245
8228
8204
8182
8160
8142
8117
8097
8079
8059
8043


I want to take these 15 records and actually number them 1 - 15 (15 - 1
actually) but cant for the life of me work it out. I've tried functions and
tmpTables but the query only wants to call the function once, i've tried to
get at the internal record counter within the query, but to no avail .. It
seems, to me, like it should be easy to do, but .. aaarrrghh ..

Sorry.

Anyone any ideas?
 
What if instead of calling the original row number, one
wanted to rank the numbers?

Is there a method to doing that?
-----Original Message-----
You might want to check out MVP Stephen Lebans'
techniques for row numbering
 
Back
Top