954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to find 5 max numbers in mysql

hye everyone..i just want to share my problem using php..:$

i have data for field total

i.e total = (2,3,4,5,62,45,67,89,10,23,11,23,98,12)

from all data i want 5 max values only. please help me to meet the solution.:)

shamsidah
Newbie Poster
22 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

What are you looking for, how to do this with a query ? Can you show the code you have so far ?

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

actually im looking the max value from my table (grandtotal). i just want to display 5 values from that.

shamsidah
Newbie Poster
22 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

It'll probably be something like this:

SELECT total FROM grandtotal ORDER BY total DESC LIMIT 5
pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

Did you want just the MAXimum value out of that set of numbers you provided us??

rotten69
Posting Whiz
346 posts since May 2011
Reputation Points: 3
Solved Threads: 16
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You