Hi,

I wonder if its possbile to make a toplist from the folowing table:

+----------+----------+
| name     | status   |
+----------+----------+
| Bob      | working  |
| Jane     | sleeping |
| Joe      | sleeping |
| Bob      | sleeping |
| Bob      | working  |
| Bob      | sleeping |
| Bob      | working  |
| Jane     | working  |
| Joe      | sleeping |
| Joe      | working  |
| Bob      | working  |
| Bob      | working  |
+----------+----------+

I would like the toplist look something like this:

+-------+---------+----------+
| name  | working | sleeping |
+-------+---------+----------+
| Bob   | 5       | 2        |
| Jane  | 1       | 1        |
| Joe   | 1       | 2        |
+-------+---------+----------+

Thanks!



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to