RANK() function
Options
Gi Ma
Member ✭
Hi everyone!
While I really love Xano so far, I'm stuck on something that's an absolute roadblock for the business case I'm trying to implement on Xano.
In MySQL, it's possible to use the RANK() function, which let's me calculate the rank of a row based on the value of one column (score_total in example below), and then later on implement that rank as a value in another row (currentrank_total in example below).
In MySQL, I currently use the following:
SET @r=0;
UPDATE `organizations` SET `currentrank_total`= @r:= (@r+1) ORDER BY `score_total` DESC;
How can I reproduce this in Xano? I just can't seem to build a similar function, and if I can't do it, this would be my devastating end to the Xano experience, even though I've so far really fallen in love with it... 😟
While I really love Xano so far, I'm stuck on something that's an absolute roadblock for the business case I'm trying to implement on Xano.
In MySQL, it's possible to use the RANK() function, which let's me calculate the rank of a row based on the value of one column (score_total in example below), and then later on implement that rank as a value in another row (currentrank_total in example below).
In MySQL, I currently use the following:
SET @r=0;
UPDATE `organizations` SET `currentrank_total`= @r:= (@r+1) ORDER BY `score_total` DESC;
How can I reproduce this in Xano? I just can't seem to build a similar function, and if I can't do it, this would be my devastating end to the Xano experience, even though I've so far really fallen in love with it... 😟
Comments
-
I would just use combinations of sorting and indexes to find your rankings. Here is a similar use case from another user's use case, hopefully it helps point you in the right direction:
-
Perfect!! Problem solved, thank you so much Michael!🚀
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback