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: queyr (maximum)

Re: queyr (maximum)

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Tue, 22 Jul 2003 16:06:36 -0700
Message-ID: <BzjTa.16$q23.50@news.oracle.com>


Hints:
1. "order by" and get the first row only 2. max(level*1000000+version)
where 1000000 may be better defined as "select max(version)"

"Max" <papouasied_at_yahoo.com> wrote in message news:3f1dbf7b$0$15328$626a54ce_at_news.free.fr...
> hi,
>
> I want the transactions and levels which level is maximum and version is
> maximum, knowing the version has priority (version > level)
>
> Transaction Level Version code
>
> teti 0 1 A
>
> titi 1 2 A
>
> tuta 0 1 B
>
> tata 1 1 B
>
> toto 0 1 C
>
> tuto 1 1 C
>
>
>
>
>
> gives:
>
>
>
> titi 1 2 A
>
> tata 1 1 B
>
> tuto 1 1 C
>
>
> The query:
> select a.transaction,max(version),max(level), a.code,
> from ma_table a
> group by a.transaction, a.level
>
>
> gives wrong results of course.
>
>
>
> Thanks for your help
>
>
>
Received on Tue Jul 22 2003 - 18:06:36 CDT

Original text of this message

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