MySQL Forums
Forum List  »  General

Calculating percentiles for each data record
Posted by: Ryan Huff
Date: July 27, 2006 04:30PM

I have a semi-large table (2000-3000 records and growing) in which I have stored a decimal for each row. This number is an *absolute* rating score for the record. I'd like to derive from this a *relative* rating for each record from .5-10, in .5 increments.

So I need to calculate which PERCENTILE each record is in, and assign the relative score accordingly.

For instance, if a record has a score of 1234.5, and I find that it's in the 65th percentile (65% of records have absolute scores <= 1234.5), then I would assign it a relative score of 6.5.

My question is, how do I figure the percentile score for each record?

I anticipate that this will be run as a batch process on a nightly basis, but I'm open to suggestions.

THANKS in advance!
- Ryan

Options: ReplyQuote


Subject
Written By
Posted
Calculating percentiles for each data record
July 27, 2006 04:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.