I have a database with posts in it, to make it simpler, say I have two fields “user” and “rate”. I want to select all of the ratings from all of the posts by user: “Joe” and add them together and display them. Then I want to do the same with the other users, to produce a leaderboard.
I do not know the names of the users in the database.
I have a database with posts in it, to make it simpler, say I
Share
The query below produce only one result which is the totalrate for user JOE
this one will show the user with the greatest rate because it was sorted based on the totalRate in descending order