Hello MySQL users, Currently, I use MySQL 4.0.22 and I can do a straightforward count of employees hired for each month.
select employee_hire_date, count(employee_id) from table_employee where employee_hire_date between "2005-01-01" and "2005-4-30" group by month(employee_hire_date) Date | Count | -------------------- 2005-01-01 | 123 | 2005-02-01 | 50 | 2005-03-01 | 76 | 2005-04-01 | 89 | However, I would like to do a grand total of the counts and the averages that would like the below. Date | Count | Sum | Avg | --------------------------------- 2005-01-01 | 123 | 338 | 84.5 | 2005-02-01 | 50 | 338 | 84.5 | 2005-03-01 | 76 | 338 | 84.5 | 2005-04-01 | 89 | 338 | 84.5 | Since my MySQL version is 4.0.22, I am not able to use subquery and I prefer not to use tmp tables. What would be the right query to solve for the grand total sum and average?? Any help would be greatly appreciated!!! Thanks in Advance. Henry -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]