Total = the total of the SUM function

2001-02-12 Thread jerome auza
Hi, I was wondering if there is a way I can do this in MySQL as a one line command: SELECT COUNT(*) as Qty, Name, 100 * Qty/(SELECT COUNT(*) from Table1) as Percent from Table1 GROUP BY Name; Currently I have to do this in two lines: SELECT COUNT(*) from Table1; SELECT COUNT(*) as Qty, Name

Help please: getting the total from the results of SUM

2001-02-13 Thread jerome auza
Hi, Is it possible to get the total from the results of SUM in the same SQL statement? I want to have this output: NameAmount Percent Name1 15 25 Name2 15 25 Name3 30 50 My database only have the first two columns and the Percent column is calculated

Re: Help please: getting the total from the results of SUM

2001-02-15 Thread jerome auza
e for percent. I want can do this calculation in one line. :) Currently I use two SELECT statements, the first to get the total, then use that value to calculate for the percent. jerome From: "Rus" <[EMAIL PROTECTED]> To: "jerome auza" <[EMAIL PROTECTED]>, <[EM