Rhino wrote:
SELECT SiteCode, TypeOfJob, count(TypeOfJob) As countJobType FROM
jobs GROUP
BY SiteCode
I think he wants something like
select SiteCode, TypeOfJob, count(TypeOfJob) As countJobType, (select *
from jobs) as alljobs, countJobType*100.0/alljobs FROM jobs GROUP BY
SiteCode
I'm pretty convinced something like this would work in Oracle or DB2 and
maybe there is way in MySQL for such a query, but I'm using currently
only mysql-4.1.12-3.RHEL4.1 and that is too old to check.
Also, it is always a good idea to state which version of MySQL you are
using; older versions, which are still in widespread use, don't have
all the functionality of newer versions. That means that a solution
that works fine in a newer version may not work at all in an older
version or may have to be adapted to work.
I agree.
--
Mladen Adamovic
http://home.blic.net/adamm
http://www.shortopedia.com
http://www.froola.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]