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: SQL min value

Re: SQL min value

From: Richard Kuhler <noone_at_nowhere.com>
Date: Thu, 22 Nov 2001 01:46:15 GMT
Message-ID: <HNYK7.42144$D5.18582586@typhoon.san.rr.com>


If you're on 9i you can use the new 'first' function....

select obj,
  min(v2),
  min(v1) keep (dense_rank first order by v2) from t1
group by obj

Note: for ties of min(v2) this take the min(v1) among them.

Richard

gil guerillot wrote:
>
> table with 3 fields OBJ,V1,V2
>
> I need sql select
> how to find for each OBJ,the V1 value corresponding at the record where V2
> is the smaller?
Received on Wed Nov 21 2001 - 19:46:15 CST

Original text of this message

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