Mysql - Rank field for a query
Posted
by Mark
on Stack Overflow
See other posts from Stack Overflow
or by Mark
Published on 2010-05-09T19:38:25Z
Indexed on
2010/05/09
19:48 UTC
Read the original article
Hit count: 212
How can I add a field that contains a rows rank within the result set of a query?
Initially I used php to rank my results as it was all on a single page. Now I have added multiple pages so now even though I am on the second page the first result on the page is still '1st'. Obviously I could multiply the page number by the number of results per page and add the result number but I imagine there is a better way within the query.
Thanks,
© Stack Overflow or respective owner