[thelist] help with SQL query

danielEthan daniel at ionize.net
Wed Jul 31 14:48:00 CDT 2002


>SELECT avg(steps) FROM tblRecordSteps where UserID='777' GROUP BY
>ProgramWeek
>
>Can i get an overall average from this - I tried using this as a subquery
>and got an error

SELECT AVG(steps)
FROM tblRecordSteps
WHERE UserID=777;

This will return the average of steps for every record that
has a UserID equal to 777. Therefore, it is irrelevant how
long they've been in the program or what stage they're in.
This will be their total average. Is this what you're
looking for?

=D



More information about the thelist mailing list