RE: Re: [PHP-DB] Most Occurring
| From: | Allsebrook_Richard/askr at askr dot easysoft dot com | Date: | Thu, 22 Feb 2001 17:57:12 +0000 |
| Subject: | RE: Re: [PHP-DB] Most Occurring | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-6876@lists.php.net to get a copy of this message | ||
Missed your original post :-( but at cinema.com we use the following
query to get a list of the actor with the most roles:
SELECT Person.Name, Count(Role.RoleID) AS CountOfRoleID
FROM Role INNER JOIN Person ON Role.PersonID = Person.ID
GROUP BY Person.Name
ORDER BY Count(Role.RoleID) DESC;
Gives the following:
Name CountOfRoleID
Clint Eastwood 41
Sean Connery 34
Dan Hedaya 30
Robert De Niro 30
Frank Welker 27
Samuel L Jackson 25
Maybe you could mangle the SQL to get what your after?
Hope this helps...
_____
~ Richard Allsebrook ~
Applications Developer and Webmaster
Easysoft Limited, Thorp Arch Grange, Thorp Arch, Wetherby, LS23 7BA, UK
http://www.easysoft.com <http://www.easysoft.com> -
http://www.cinema.com <http://www.cinema.com>
"A computer lets you make more mistakes faster than any invention in
human history - with the possible exceptions of handguns and tequila."
_____
-----Original Message-----
From: lennin [mailto:lennin@conexion.com]
Sent: Thursday, February 22, 2001 5:43 PM
To: php-db
Cc: lennin
Subject: FW: Re: [PHP-DB] Most Occurring
you mean the "mode".
I'm afraid you'll have to do it by hand. Other databases do have
functions
for a couple of statistics measures( though not sure the mode is
included),
but MYSQL doesn't.
Lennin Arriola
lennin@conexion.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
Attachment: [application/rtf]
Attachment: [application/rtf]