If I am understanding you correctly, you don't mind that these 'row numbers'
will change every time something gets inserted into the list? That is, are
you asking for a row ranking by Name order?
So, if your table contains:
you want the numbers to appear:
but if you insert 'Bates' you'll get
If this is the behavior you want, try this (got no DDL, so working from
select t.LastName, Rank = count(*)
from Table t
inner join Table t1 on (t1.LastName <= t.LastName)
group by t.LastName
Quote:> I need to show the row number that is being displayed in a query. I am
going to reorganize the data by Last Name when I select it and I want to
associate the proper Alpha number with it.
> I would prefer NOT to use the Identity column.
> Duane Hauser
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!