Home » Performance » MySQL » update field with ranking
update field with ranking [message #980] Sat, 24 March 2007 08:06 Go to next message
carpii  is currently offline carpii
Messages: 46
Registered: November 2006
Member
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
Re: update field with ranking [message #989 is a reply to message #980 ] Mon, 26 March 2007 08:33 Go to previous messageGo to next message
tanj  is currently offline tanj
Messages: 16
Registered: March 2007
Location: France
Junior Member
Reading this article may help :

http://arjen-lentz.livejournal.com/55083.html
Re: update field with ranking [message #997 is a reply to message #989 ] Tue, 27 March 2007 16:05 Go to previous message
carpii  is currently offline carpii
Messages: 46
Registered: November 2006
Member
Interesting and useful link, thanks!
Previous Topic:ORDER BY slowing down query
Next Topic:Key Cache Behaviour
Goto Forum:
  



Current Time: Thu Jan 8 22:50:51 EST 2009

Total time taken to generate the page: 0.02698 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge