Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL min value
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
![]() |
![]() |