I have two tables, Users and DoctorVisit
User - UserID - Name
DoctorsVisit - UserID - Weight - Date
The doctorVisit table contains all the visits a particular user did to the doctor. The user's weight is recorded per visit.
Query: Sum up all the Users weight, using the last doctor's visit's numbers. (then divide by number of users to get the average weight)
Note: some users may have not visited the doctor at all, while others may have visited many times.
I need the average weight of all users, but using the latest weight.
Update
I want the average weight across all users.