#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    44
    Rep Power
    15
    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. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    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)

Similar Threads

  1. Select returns all except one row
    By MrTee1 in forum PHP Development
    Replies: 10
    Last Post: February 6th, 2004, 09:33 AM
  2. select entire row, format one column
    By emory in forum MySQL Help
    Replies: 9
    Last Post: February 3rd, 2004, 01:39 PM
  3. How to select specific MySQL row?
    By IceHammer in forum PHP Development
    Replies: 8
    Last Post: January 10th, 2004, 11:16 AM
  4. Dynamic select boxes per result row
    By TuxLives in forum PHP Development
    Replies: 0
    Last Post: January 6th, 2004, 10:16 PM
  5. Mysql update: 0 rows Select: 1 row ?
    By Cyclefreak in forum MySQL Help
    Replies: 2
    Last Post: January 3rd, 2004, 11:06 AM

IMN logo majestic logo threadwatch logo seochat tools logo