Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL "Top N Percent" Equivelant

Status
Not open for further replies.

Akumadevil

Programmer
Sep 25, 2005
9
AU
Hi,
I realise MySQL doesn't have a SELECT TOP 10 PERCENT ... function, but was wondering is there another way to do this?

A generic query like below will return the 5 tallest people. But what about the top 10% of tallest people?

SELECT name, height
FROM people
ORDER BY height DESC
LIMIT 5


Any help would be appreciated,
thanks.
 
You'll want to post this in the MySQL forum.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top