Hi,
I am trying to retrieve the max, min and the 90th percentile from a table of results.
I want the 90th percentile for duration based on the timestamp_ in asc order.
My Table looks like this:
TIMESTAMP_ | DURATION |
24/01/2000 12:04:45.120 | 454 |
26/10/200 12:13:49.440 | 301 |
06/01/2001 15:12:05.760 | 245 |
23/01/2001 10:56:55.680 | 462 |
16/02/2001 12:10:39.360 | 376 |
19/04/2001 09:22:45.120 | 53 |
13/05/2001 12:36:34.560 | 330 |
30/05/2001 14:47:45.600 | 796 |
07/08/2001 08:51:47.520 | 471 |
25/08/2001 14:24:08.640 | 821 |
I have 2 queries to retrive this info, but is there a simpler solution by using one query. here are my queries:
Select MIN(DURATION), max(DURATION)
from t
;
select DURATION as nine from t
where TIMESTAMP_ =
(
select
Percentile_disc(0.90) within group (order by TIMESTAMP_) AS nth
from t
)
THANKS