I'm making a raking system. I want get the line in one request.
Here is a DB fiddle of my complete example: https://www.db-fiddle.com/f/3Com2wnrhaqfiTKqJSZtft/0
In the example, the UUID used is 36619b04-4fbe-4ba9-8bd6-aaba7df74bb6. As the first query show, it should be 4. But the second query return 2. The +1 in the query is to start ranking at 1 instead of 0. The date_created column is for a second ordering (if same value, we check according to date). With this system, it force to have a unique rank (there is no equality).
Actually, with the first request, I get the ranking in my program with a simple increment. But, for the second query I can't as I want the rank of someone that could be the 12502th.
How can I fix it?