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: chosing id of max values

Re: chosing id of max values

From: Gints Plivna <gints.plivna_at_gmail.com>
Date: Wed, 25 Jul 2007 11:50:41 +0300
Message-ID: <6e49b6d00707250150r42d0c2acq6d468ce4862e14bb@mail.gmail.com>


Ahhh OK then I didn't understood a bit
OK then one option is to do in two steps 1. get both start_time and max(start_time) over (partition by channel) 2. filter out only those where start_time = max(start_time) over (partition by channel)
Something like:
SELECT * FROM (
  SELECT other_cols, start_time, max(start_time) over (partition by channel) max_start_time
  FROM blah
)
WHERE start_time = max_start_time

Gints Plivna
http://www.gplivna.eu

2007/7/25, Remigiusz Sokolowski <rems_at_wp-sa.pl>:
> Gints Plivna wrote:
> > A simple max(start_time) over (partition by channel) won't work?
> >
> May be I was too laconic
> I have thought about getting only value of rows, of which one particular
> value is max for the whole group - so I am not interested in rows which
> have this particular value less than max. "A simple max(start_time) over
> (partition by channel)" gives me all rows while I need only those which
> start_time=max(start_time) over (partition by channel). Solutions I have
> provided gives me exactly what I need, however I try to find more of
> them, then compare them and choose one... :-)
>
> Regards
> Remigiusz
>
>
> --
> ---------------------------------------------------------------------
> Remigiusz Sokolowski <rems_at_wp-sa.pl>
> WP/PTI/DIP/ZAB (+04858) 52 15 770
> MySQL v04.x,05.x; Oracle v10.x
>
> Zastrzezenie:
> Niniejsza wiadomosc stanowi jedynie wyraz prywatnych pogladow autora
> i nie jest w zadnym wypadku zwiazana ze stanowiskiem przedsiebiorstwa
> Wirtualna Polska S.A.
> ---------------------------------------------------------------------
>
>
>
> WIRTUALNA POLSKA SA, ul. Traugutta 115c, 80-226 Gdansk; NIP: 957-07-51-216;
> Sad Rejonowy Gdansk-Polnoc KRS 0000068548, kapital zakladowy 62.880.024 zlotych (w calosci wplacony)
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jul 25 2007 - 03:50:41 CDT

Original text of this message

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