'LinKin Posted February 21, 2014 Share Posted February 21, 2014 Hi I've a SQL table. I want to sort it DESC by the value 'points'. I already know how to do that. But I what I want to do is to return something like this: 1. Account Points 2. Account Points 3. Account Points 4. Account Points 5. Account Points 77. myAccount my Points So I want to return the top 5 + my position in the table (so the rank) and my data. How can I do that? Link to comment
Castillo Posted February 21, 2014 Share Posted February 21, 2014 You are using executeSQLQuery? if so, then it returns a table, the index is the position. Link to comment
tosfera Posted February 23, 2014 Share Posted February 23, 2014 You are using executeSQLQuery? if so, then it returns a table, the index is the position. and after you got the table, you can use a loop to get the first 5 elements without writing 5 sentences. After that you should just select your own one. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now