Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with percentile_disc

Author  Topic 

da_shee
Starting Member

2 Posts

Posted - 2011-05-13 : 08:27:50
Hi

I just started using SQL recently in an Oracle environment.

I have the following code that returns a 99th percentile value for field_1.

SELECT COUNT (*),

percentile_disc(0.99) within group (order by field_1) as "99% Count",

FROM table

WHERE date >= TO_DATE (2010)
AND date < TO_DATE (2011)


Sometimes however, I need the value for another field called field_2 that corresponds to the 99th percentile value for field_1. In other words, the value for field_2 that is right next to the 99th percentile value of field_1.

If anyone could help it would be appreciated.

da_shee

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-05-13 : 08:39:48
Maybe you can get better help here:

http://www.dbforums.com/oracle/

because this is a MS SQL Server forum only.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

da_shee
Starting Member

2 Posts

Posted - 2011-05-13 : 08:41:10
Thank you
Go to Top of Page
   

- Advertisement -