Hi,

How can I construct a query that would give me a percentage, 
eg - I would like to replace the hardcoded integer value 1234567,
with a "calculated" SUM figure. The integer 1234567 is the SUM of
all the Packets in the whole table.

SELECT SrcIp,
        SUM(Packets),
        SUM(Packets)/1234567*100 AS Percentage
FROM tblIp
GROUP BY SrcIp;


Chris Andrew
Oxspring Network Solutions Limited
Tel: +44 (0)1226 761188
Fax: +44 (0)1226 761199

Email: [EMAIL PROTECTED]
Web: www.oxspring.com


---------------------------------------------------------------------
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