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.
| Author |
Topic |
|
tfountain
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-03-06 : 09:14:26
|
| I have data that looks like below (columns are Timestamp, Offered, Answered and Delay). I'm looking to exclude returning records that have a value for Delay that are within the top 10% of values of that column. Are there any 2005 tricks where this can be accomplished in a simple statement?2008-02-18 08:30:00 23 22 1732008-02-18 08:45:00 21 20 1742008-02-18 09:00:00 24 25 2302008-02-18 09:15:00 28 28 2772008-02-18 09:30:00 25 22 159 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-06 : 09:33:01
|
| Can you post you sample data with expected o/p to make your requirement clear? |
 |
|
|
tfountain
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-03-06 : 09:35:38
|
| Sample data is in the original post along with this statement - "I'm looking to exclude returning records that have a value for Delay that are within the top 10% of values of that column".I'm not sure how else to state the requirement. |
 |
|
|
tfountain
Constraint Violating Yak Guru
491 Posts |
Posted - 2008-03-06 : 10:29:03
|
| I found using NTILE in combination with a CTE helps me plot my data into percentiles the way I need to. Then I can ignore certain records based on that. I used the following URL as an example: http://weblogs.sqlteam.com/jeffs/archive/2008/02/21/Top-N-Percent-per-Group.aspx |
 |
|
|
|
|
|