Forum Moderators: open

Message Too Old, No Replies

my sql beginner

sorting records to find highest rating

         

spanjj

12:52 pm on Nov 2, 2007 (gmt 0)

10+ Year Member



hi i need some php code to get the id of the record with the highest rating in a table called 'beats'... tried some code myself but cant seem to get it to work... thanks in advance!

Demaestro

7:59 pm on Nov 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There really isn't enough information about what exactly you want to do.

Venturing a guess I would say you want something like this.

Select
the_id
from
the_table
sort on
the_rating desc
limit 1