Skip to content
Advertisement

How to update database table with sql dense ranking function

I have this code in my project

JavaScript

The problem here is that the update query updates position column wit 1,2,3,4,5,6 etc and not observing dense ranking function. Please help

enter image description here

Advertisement

Answer

Use DISTINCT to get unique total values of a subject. Then use it to update the ranking:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement