BlackEyes Posted June 1, 2013 Share Posted June 1, 2013 (edited) I have a table that looks like: The problem is after using this query: SET @r=0; UPDATE times SET points:= @r:= (@r+1) ORDER BY MapID, Type, Style, Time DESC; It doesn't reset r to 0 once MapID OR Type OR Style change If I were to order it by MapID, Type, Style, and Time right now, it would look like this: If r were to reset once MapID, Type, or Style change, points would look like 1,1,1,1,1,1,1. Sorry, I'm the only player who tested my timer at this stage so of course I would be the only one getting ranked, giving me 1 point in each record If someone else were to get a record on MapID 1, Type 0, and Style 0 and they also got a better time than me, they would get 2 points and I would get 1. It is basically ranking in a descending order in different categories. EDIT: I think I have to make sure the entire query that ranks everything is in one statement. I don't believe sourcepawn has support for multiple statements in one query. Edited June 1, 2013 by BlackEyes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.