Determine Percentages

2001-09-03 Thread Chris Andrew
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),

Re: Determine Percentages

2001-09-03 Thread Carl Troein
Chris Andrew writes: I would like to replace the hardcoded integer value 1234567, with a calculated SUM figure. SELECT SrcIp, SUM(Packets), SUM(Packets)/1234567*100 AS Percentage FROM tblIp GROUP BY SrcIp; Either divide it into two queries and use the result of the first