[PHP-DB] One last step

2002-09-03 Thread RClark

Hello all,

  I have a MySQL database with some 2 million rows in it. I am counting all
of the different names in one column. How to I get these to come out in
descending order, with the most numbers of one event at the top and going
down from there?

Thanks in advance,
Ron Clark



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] One last step

2002-09-03 Thread Ignatius Reilly

Try

SELECT name, COUNT(*) AS nb
FROM mytable
GROUP BY name
ORDER BY nb DESC

Ignatius


RClark [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello all,

   I have a MySQL database with some 2 million rows in it. I am counting
all
 of the different names in one column. How to I get these to come out in
 descending order, with the most numbers of one event at the top and going
 down from there?

 Thanks in advance,
 Ron Clark



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


- Original Message -
From: RClark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 03, 2002 4:27 PM
Subject: [PHP-DB] One last step


 Hello all,

   I have a MySQL database with some 2 million rows in it. I am counting
all
 of the different names in one column. How to I get these to come out in
 descending order, with the most numbers of one event at the top and going
 down from there?

 Thanks in advance,
 Ron Clark



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php