Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Top-N with a twist

RE: Top-N with a twist

From: Steve Adams <steve.adams_at_ixora.com.au>
Date: Tue, 12 Sep 2000 09:50:34 +1000
Message-Id: <10616.116675@fatcity.com>


Hi Yosi,

If you have 8.1.6, then you can use the RANK analytical function.

@ Regards,
@ Steve Adams
@ http://www.ixora.com.au/
@ http://www.christianity.net.au/
@
@ Going to OpenWorld?
@ Catch the Ixora performance tuning seminar too!
@ See http://www.ixora.com.au/seminars/ for details.

-----Original Message-----
From: Yosi Greenfield [mailto:yosi_at_comhill.com] Sent: Tuesday, 12 September 2000 8:21
To: Multiple recipients of list ORACLE-L Subject: Top-N with a twist

Ok, so we know how to use nested views to return a top-n report, right? Use order by in the nested view and use rownum in the outside view. Great.

What about to doing this for groups? I can't figure it out and it's making me nuts. (I'm sure some would argue that opinion. ) Example - I want the top ten selling employees for each department, or I want the top ten diagnoses in each clinic.

I've even pregrouped and pre-summed the employees or pre-counted the diagnoses so its a simple non-aggregate query I'm running. I just want to limit the results to 10 or 20 or 30 rows per region or clinic or Received on Mon Sep 11 2000 - 18:50:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US