# update field with ranking

**URL:** <https://forums.percona.com/t/update-field-with-ranking/259>\
**Category:** Other MySQL® Questions\
**Created:** [March 24, 2007, 6:36am UTC](https://forums.percona.com/t/update-field-with-ranking/259 "2007-03-24T06:36:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carpii](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@carpii](https://forums.percona.com/u/carpii)\
**Post date:** [March 24, 2007, 6:36am UTC](https://forums.percona.com/t/update-field-with-ranking/259/1 "2007-03-24T06:36:06Z")

</div>

Hi, is there an efficient way to update a table with the rank of that row, given a specific order by

lets say i have

Table: users  
userid int  
score int  
rank int

select \* from users order by score DESC

I want to update the rank field, to the corresponding row number in the above query

Thanks

---

<div class="post-metadata">

**Author:** ![tanj](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@tanj](https://forums.percona.com/u/tanj)\
**Post date:** [March 26, 2007, 7:03am UTC](https://forums.percona.com/t/update-field-with-ranking/259/2 "2007-03-26T07:03:45Z")

</div>

Reading this article may help :

[URL][http://arjen-lentz.livejournal.com/55083.html[/URL]](http://arjen-lentz.livejournal.com/55083.html%5B/URL%5D)

---

<div class="post-metadata">

**Author:** ![carpii](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@carpii](https://forums.percona.com/u/carpii)\
**Post date:** [March 27, 2007, 2:35pm UTC](https://forums.percona.com/t/update-field-with-ranking/259/3 "2007-03-27T14:35:32Z")

</div>

Interesting and useful link, thanks!
