Re: Total Sum of Monthly Counts for Older MySQL 4.0.22 (Please Help)

2005-07-28 Thread Gleb Paharenko
Hello. It is possible to obtain your results without temporary tables, but with user variables. For a pity you should execute three queries. With first query you're getting the Sum: select @all_sum:= count( employee_id) from table_employee where employee_hire_date between

Re: Total Sum of Monthly Counts for Older MySQL 4.0.22 (Please Help)

2005-07-28 Thread Michael Stassen
Without knowing more of your requirements, I find seeing the grand total and overall average repeated in every row strange from a usability perspective. Do you really need that, or were you just hoping to get that information out of your query? I'd suggest something like: SET @sum=0, @m=0;

Total Sum of Monthly Counts for Older MySQL 4.0.22 (Please Help)

2005-07-27 Thread Henry Chang
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 |