views:

20

answers:

1

I'm trying to figure out the overall ratio for users. There is basically two columns I need to look at to figure out the ratio, total_emails and total_hours.

SELECT sum(total_emails/total_hours) as ratio FROM table WHERE id= 1 LIMIT 0, 1;

This appears to adding the ratio up multiple times and I get a number like 8.45 when I should be getting something like .45

Any idea what I'm doing wrong?

+1  A: 

Try:

SELECT sum(total_emails) / SUM(total_hours) as ratio 
FROM table 
WHERE id = 1 
LIMIT 0, 1; 
RedFilter
duh! thanks!!!!
mike