Thread: Highest Values
View Single Post
  #1 (permalink)  
Old May 3rd, 2007, 22:00
robukni robukni is offline
Up'n'Coming Member
Join Date: Jan 2006
Location: NI
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Highest Values

Hi can anyone tell me how to display the top 3 fields from a MySQL database in order of highest number

I have a voting system like so:

id---total_votes---total_value
1 -------- 3 -------- 23
2 -------- 2 -------- 42
3 -------- 6 -------- 10
4 -------- 2 -------- 9
5 -------- 1 -------- 11


I want it to display the top 3 total_value fields which in this case would be:

ID 2, 3 and 5


Can anyone help?


Thanks
Robert
Reply With Quote