Jump to content

Need help for ranking order


vearns

Recommended Posts

Hello,

i need help for ranking order.

 

currently i used this SQL statement to generate a descending result :

 

SELECT name, COUNT( customerid ) AS orderCount
FROM contest
GROUP BY name
ORDER BY orderCount DESC

 

Let say the descending result is :

 

John 5

Tom 4

Mark 3

Jane 2

Vivian 1

 

i want to output :

 

Mark is on the 3rd out of 5th.

 

how to do it in MySQL and PHP ?

Link to comment
https://forums.phpfreaks.com/topic/139995-need-help-for-ranking-order/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.