Ranks and ties
| From: | Melissa Tonelli | Date: | Wed, 21 Jun 2000 01:56:06 +0000 |
| Subject: | Ranks and ties | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-2426@lists.php.net to get a copy of this message | ||
Hello, I have a table that contains info on big companies and the number of employees at each. Like this:
Table Companies
--------------------------------
CoName
CoCity
CoEmployees
I run a query that outputs the data by CoEmployees descending, so that the largest companies are listed first. The output is a simple HTML table. Now I want to add a column to the output that shows the RANK of each company and I have two questions:
1. How, exactly, do I do that? I'm unsure of the best/fastest method.
2. How do I deal with companies that have the same number of employees? I would like them to share the rank.
Thanks in advance for hints/suggestions.
---
mtonelli@bway.net
phone 718 728 7567 * fax 718 728 4420