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

Home -> Community -> Usenet -> c.d.o.misc -> Re: top N with respect to day and other field

Re: top N with respect to day and other field

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 09 Aug 2007 17:23:28 -0700
Message-ID: <1186705408.338964@bubbleator.drizzle.com>


Nikolas Tautenhahn wrote:
> DA Morgan wrote:

>> Consider using GROUP BY.

>
> Well but how should I use group by if I have two or more attributes in
> something like hierarchical order (date, then lup_dir) and I don't want
> to aggregate the data from the base table any further, but I want to
> select some tuples out of them just as they are (and ignore the others).
>
> I am a little bit unsure which group-by-aggregate functions you would
> suggest/use here.
>
> I thought about FIRST but in fact I don't think that the first row
> returned by dense rank will be quite useful to me...
>
> Regards,
> N.

Using an in-line view.

If you aren't familiar with them:
http://www.psoug.org/reference/inline_view.html or find them in Morgan's Library at www.psoug.org

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Aug 09 2007 - 19:23:28 CDT

Original text of this message

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