I have a query that shows the top N count(*)'s.
So it's basically:
select some_val, count(*)
from big_table
group by some_val
order by count(*)
limit 50
Now, I would like to have the rank included in the result set. The
first row would be 1, followed by 2, etc. all the way to 50.
I can do this in PHP, but stuffing it into the DB query makes other
things easier.
Any ideas?
Thanks.
-Don
--
Donald Drake
President
Drake Consulting
http://www.drakeconsult.com/
http://www.MailLaunder.com/
312-560-1574