Results 1 to 13 of 13
Aug 15, 2012, 04:07 #1
- Join Date
- Dec 2005
- 0 Post(s)
- 0 Thread(s)
Getting avg points from each user?
I'm trying to figure out how to get avg(points) from each user in a table and then order them by the user with the highest average first...
here is what I have tried but with no luck:
$sql = "SELECT *, AVG(points) points FROM nf_users WHERE played > 0 GROUP BY id ORDER BY points DESC LIMIT 100"; $qry = mysql_query($sql) or die(mysql_error());