Database Administration (MOSC)

MOSC Banner

How to eliminate outliers.

edited Sep 18, 2009 7:08PM in Database Administration (MOSC) 7 commentsAnswered ✓
  I'd like to remove the top and bottom N values. I think I'm close.

Here's what I'm working with where I fudge the rownum values to make the query work
as I know there are 220 rows. So I want all values without the top and bottom N.

How can I at run time do something like

rownum <= count(*) -N

For rnum it would be easy enough as I could just do....

rnum >= +N


select * from
    (
           select p.*, rownum rnum
                   from (
                select PRCSNAME,datediff('mi',enddttm,begindttm )*-1
                from PROCESS_SCHEDULER_HISTORY where prcsname=<job name>
                order by datediff('mi',enddttm,begindttm )*-1 desc

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center