Hi I'm looking to create a map in node.js where I'm able to put numbers in ranking order so for example 14, 10 and 5 in a list order where #1 takes the highest number and #3 the lowest number For example:
| Rank | Numer |
|---|---|
| #1 | 14 |
| #2 | 10 |
| #3 | 5 |
As you can see I'm wanting 14 the largest number therefore rank #1 and so forth.I'm going to be fetching my numbers from table in postgres.
My SQL query looks like this:
pool.query('SELECT total_xp FROM levels WHERE guild_id = $1 AND user_id = $2', [message.guild.id, member.id])
If anyone can help me on how I can achieve this help would be appreciated.