MySQL Forums
Forum List  »  Newbie

Re: Calculation of a '95th percentile'
Posted by: angel rivero
Date: August 02, 2010 08:55AM

Rick James Wrote:
-------------------------------------------------------
> SELECT @ct := COUNT(*) FROM PCT_O2_PPM;


Thanks:

mysql> CREATE TEMPORARY TABLE cm714.PCT_O2_PPM (seq INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) SELECT O2_PPM FROM cm714.listfiles ORDER BY O2_PPM;
mysql> SELECT @ct := COUNT(*) FROM cm714.PCT_O2_PPM;
+-----------------+
| @ct := COUNT(*) |
+-----------------+
|              50 |
+-----------------+
1 row in set (0.00 sec)

mysql> SELECT O2_PPM FROM cm714.PCT_O2_PPM WHERE seq >= 0.90 * @ct ORDER BY seq LIMIT 2;
+----------+
| O2_PPM   |
+----------+
| 22400.00 |
| 23995.00 |
+----------+
2 rows in set (0.00 sec)

I need this output 22559.5 -formula =PERCENTILE(B2:B51;0,9) calculate from excel-



Edited 1 time(s). Last edit at 08/02/2010 08:56AM by angel rivero.

Options: ReplyQuote


Subject
Written By
Posted
Re: Calculation of a '95th percentile'
August 02, 2010 08:55AM


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.