|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi there, i have a simple request. i have to do a select statement in a table to find out what row is ranked where, when ordered from greatest to least.
For example: if the ratings are 1, 4, 6.7, 10, I want to be able to find out what spot the number 4 would be at, without looping throughout the entire list. Is there a ROWlOCATION function or something? Thanks. Decius. |
|
#2
|
|||
|
|||
|
select * from table_name order by rank desc limit 3,1;
Would return the row with the 4th highest rank. limit m,n (m is the index of the row to start the return from ... 0 is the first, and n is the number of rows to return) |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Select, Row location for rank |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|