% woes

potts

Registered User.
Local time
Today, 00:09
Joined
Jul 24, 2002
Messages
87
I have a table that contains 4 pieces of info:

Session
Position
Work
Rest

What I want to do is calculate the % of work that was less than 10 for each position in each session.

Any ideas??
 
SELECT COUNT(*) as HowMany, Sum(Work) as TotalWork, Session, Position
from MyTable
Group By Session, Position
Having TotalWork / Count(*) < 10

Or something close to that, you may need to add null or zero checking.
 

Users who are viewing this thread

Back
Top Bottom